Fix for comma separated tags on the command line

- also added more test for tags
This commit is contained in:
Phil Nash
2013-09-25 18:40:07 +01:00
parent 649cd13c4d
commit 41b27af45b
2 changed files with 19 additions and 7 deletions

View File

@@ -86,7 +86,7 @@ std::string parseIntoConfigAndReturnError( const char * (&argv)[size], Catch::Co
return "";
}
inline Catch::TestCase fakeTestCase( const char* name ){ return Catch::makeTestCase( NULL, "", name, "", CATCH_INTERNAL_LINEINFO ); }
inline Catch::TestCase fakeTestCase( const char* name, const char* desc = "" ){ return Catch::makeTestCase( NULL, "", name, desc, CATCH_INTERNAL_LINEINFO ); }
TEST_CASE( "Process can be configured on command line", "[config][command-line]" ) {
@@ -336,6 +336,15 @@ TEST_CASE( "selftest/tags", "" ) {
CHECK( twoTags.matchesTags( p4 ) == true );
CHECK( twoTags.matchesTags( p5 ) == true );
}
SECTION( "complex", "" ) {
CHECK( fakeTestCase( "test", "[one][.]" ).matchesTags( p1 ) );
CHECK_FALSE( fakeTestCase( "test", "[one][.]" ).matchesTags( p5 ) );
CHECK( fakeTestCase( "test", "[three]" ).matchesTags( p4 ) );
CHECK( fakeTestCase( "test", "[three]" ).matchesTags( p5 ) );
CHECK( fakeTestCase( "test", "[three]" ).matchesTags( "[three]~[one]" ) );
CHECK( fakeTestCase( "test", "[unit][not_apple]" ).matchesTags( "[unit]" ) );
CHECK_FALSE( fakeTestCase( "test", "[unit][not_apple]" ).matchesTags( "[unit]~[not_apple]" ) );
}
SECTION( "one tag with characters either side", "" ) {