Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2012-08-24 08:23:50 +0100
committerPhil Nash2012-08-24 08:23:50 +0100
commit4c97fc5619d6fcef7b068a9ed428c54bce196b18 (patch)
treedaac0662c2c49d7fab4b8b618a47e73d37fc2764 /projects/SelfTest/TestMain.cpp
parent56d5c429121cfa6770961d22a9ef8191a30867ce (diff)
downloadcatch3-4c97fc5619d6fcef7b068a9ed428c54bce196b18.tar.gz
WIldcards at both ends
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
-rw-r--r--projects/SelfTest/TestMain.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index 42185757..8760646a 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -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 );
+}