mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
WIldcards at both ends
This commit is contained in:
@@ -251,7 +251,7 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "selftest/test filter", "Groups of tests can be selected" ) {
|
||||
TEST_CASE( "selftest/test filter", "Individual filters" ) {
|
||||
|
||||
Catch::TestCaseFilter matchAny( "*" );
|
||||
Catch::TestCaseFilter matchNone( "*", Catch::IfFilterMatches::ExcludeTests );
|
||||
@@ -268,7 +268,7 @@ TEST_CASE( "selftest/test filter", "Groups of tests can be selected" ) {
|
||||
CHECK( matchNonHidden.shouldInclude( makeTestCase( "./any" ) ) == false );
|
||||
}
|
||||
|
||||
TEST_CASE( "selftest/test filters", "Groups of tests can be selected" ) {
|
||||
TEST_CASE( "selftest/test filters", "Sets of filters" ) {
|
||||
|
||||
Catch::TestCaseFilter matchHidden( "./*" );
|
||||
Catch::TestCaseFilter dontMatchA( "./a*", Catch::IfFilterMatches::ExcludeTests );
|
||||
@@ -282,3 +282,18 @@ TEST_CASE( "selftest/test filters", "Groups of tests can be selected" ) {
|
||||
CHECK( filters.shouldInclude( makeTestCase( "./something" ) ) );
|
||||
CHECK( filters.shouldInclude( makeTestCase( "./anything" ) ) == false );
|
||||
}
|
||||
|
||||
TEST_CASE( "selftest/filter/prefix wildcard", "Individual filters with wildcards at the start" ) {
|
||||
Catch::TestCaseFilter matchBadgers( "*badger" );
|
||||
|
||||
CHECK( matchBadgers.shouldInclude( makeTestCase( "big badger" ) ));
|
||||
CHECK( matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) == false );
|
||||
}
|
||||
TEST_CASE( "selftest/filter/wildcard at both ends", "Individual filters with wildcards at both ends" ) {
|
||||
Catch::TestCaseFilter matchBadgers( "*badger*" );
|
||||
|
||||
CHECK( matchBadgers.shouldInclude( makeTestCase( "big badger" ) ));
|
||||
CHECK( matchBadgers.shouldInclude( makeTestCase( "little badgers" ) ) );
|
||||
CHECK( matchBadgers.shouldInclude( makeTestCase( "badgers are big" ) ) );
|
||||
CHECK( matchBadgers.shouldInclude( makeTestCase( "hedgehogs" ) ) == false );
|
||||
}
|
||||
|
Reference in New Issue
Block a user