diff options
| author | Phil Nash | 2013-10-17 18:02:09 +0100 |
|---|---|---|
| committer | Phil Nash | 2013-10-17 18:02:09 +0100 |
| commit | aafed303bb72d2aa40a3513e714c4c8ad9146c19 (patch) | |
| tree | f9b78d7157450872a8c735b1685ef6df7a6a75cf | |
| parent | 34266b6e0fee3bb481f5549c91a3c8e0a0f8d69f (diff) | |
| download | catch3-aafed303bb72d2aa40a3513e714c4c8ad9146c19.tar.gz | |
Added an extra tag test
| -rw-r--r-- | projects/SelfTest/TestMain.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index aae3f53b..dc2684ed 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -298,7 +298,7 @@ int getArgc( const char * (&)[size] ) { return size; } -TEST_CASE( "selftest/tags", "" ) { +TEST_CASE( "selftest/tags", "[tags]" ) { std::string p1 = "[one]"; std::string p2 = "[one],[two]"; @@ -306,7 +306,7 @@ TEST_CASE( "selftest/tags", "" ) { std::string p4 = "[one][two],[three]"; std::string p5 = "[one][two]~[.],[three]"; - SECTION( "one tag", "" ) { + SECTION( "single [one] tag", "" ) { Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[one]", CATCH_INTERNAL_LINEINFO ); CHECK( oneTag.getTestCaseInfo().description == "" ); @@ -320,6 +320,20 @@ TEST_CASE( "selftest/tags", "" ) { CHECK( oneTag.matchesTags( p5 ) == false ); } + SECTION( "single [two] tag", "" ) { + Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[two]", CATCH_INTERNAL_LINEINFO ); + + CHECK( oneTag.getTestCaseInfo().description == "" ); + CHECK( oneTag.hasTag( "two" ) ); + CHECK( oneTag.getTags().size() == 1 ); + + CHECK( oneTag.matchesTags( p1 ) == false ); + CHECK( oneTag.matchesTags( p2 ) == true ); + CHECK( oneTag.matchesTags( p3 ) == false ); + CHECK( oneTag.matchesTags( p4 ) == false ); + CHECK( oneTag.matchesTags( p5 ) == false ); + } + SECTION( "two tags", "" ) { Catch::TestCase twoTags= makeTestCase( NULL, "", "test", "[one][two]", CATCH_INTERNAL_LINEINFO ); @@ -567,3 +581,15 @@ TEST_CASE( "Text can be formatted using the Text class", "" ) { CHECK( Text( "hi there", narrow ).toString() == "hi\nthere" ); } + +TEST_CASE( "Long text is truncted", "[Text][Truncated]" ) { + + std::string longLine( 90, '*' ); + + std::ostringstream oss; + for(int i = 0; i < 600; ++i ) + oss << longLine << longLine << "\n"; + Text t( oss.str() ); + CHECK_THAT( t.toString(), EndsWith( "... message truncated due to excessive size" ) ); + +} |