diff options
| author | Martin Hořeňovský | 2022-05-10 19:16:50 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-05-10 20:57:50 +0200 |
| commit | d60fbe49be5737d2a01f67ff54f8dca37253a20c (patch) | |
| tree | 24341b0bba6cc76bc351f2afcf9b5001aa36b9b4 | |
| parent | a733b58cd2a9d90b73f182a6277ce6cc6425a4c3 (diff) | |
| download | catch3-d60fbe49be5737d2a01f67ff54f8dca37253a20c.tar.gz | |
Slight improvement for reporter test
9 files changed, 17 insertions, 15 deletions
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index 0f5d6fb9..bc88e377 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -1888,10 +1888,10 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("[fa 1 tag " contains: "[fakeTag]" -Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index f3655ea8..7d33ae33 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -1881,10 +1881,10 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("[fa 1 tag " contains: "[fakeTag]" -Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 67cc096c..0078f507 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -13420,12 +13420,12 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) ) with expansion: "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) ------------------------------------------------------------------------------- The default listing implementation write to provided stream diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index d8c521dd..96a8268d 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -13413,12 +13413,12 @@ Reporters.tests.cpp:<line number> ............................................................................... Reporters.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) ) with expansion: "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) ------------------------------------------------------------------------------- The default listing implementation write to provided stream diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index b893dcdd..4cd3cef3 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -3335,7 +3335,7 @@ ok {test-number} - 1 == 2 # TODO # The default listing implementation write to provided stream ok {test-number} - listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" # The default listing implementation write to provided stream -ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" +ok {test-number} - listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description " ( contains: "fake reporter" and contains: "fake description" ) # The default listing implementation write to provided stream ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) # This test 'should' fail but doesn't diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 3cbba8f6..a87ce7c6 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -3328,7 +3328,7 @@ ok {test-number} - 1 == 2 # TODO # The default listing implementation write to provided stream ok {test-number} - listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" # The default listing implementation write to provided stream -ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" +ok {test-number} - listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) for: "Available reporters: fake reporter: fake description " ( contains: "fake reporter" and contains: "fake description" ) # The default listing implementation write to provided stream ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) # This test 'should' fail but doesn't diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 6a8bf396..4523d64a 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -15727,13 +15727,13 @@ Message from section two <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, ContainsSubstring("fake reporter"s) + listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) </Original> <Expanded> "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index 214a28dd..4c20e564 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -15727,13 +15727,13 @@ Message from section two <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - listingString, ContainsSubstring("fake reporter"s) + listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s ) </Original> <Expanded> "Available reporters: fake reporter: fake description -" contains: "fake reporter" +" ( contains: "fake reporter" and contains: "fake description" ) </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> diff --git a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp index 5288709d..5e8f11c7 100644 --- a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp @@ -66,7 +66,9 @@ TEST_CASE( "The default listing implementation write to provided stream", Catch::defaultListReporters(sstream.stream(), reporters, Catch::Verbosity::Normal); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, ContainsSubstring("fake reporter"s)); + REQUIRE_THAT( listingString, + ContainsSubstring( "fake reporter"s ) && + ContainsSubstring( "fake description"s ) ); } SECTION( "Listing tests" ) { Catch::TestCaseInfo fakeInfo{ |