Slight improvement for reporter test

This commit is contained in:
Martin Hořeňovský 2022-05-10 19:16:50 +02:00
parent a733b58cd2
commit d60fbe49be
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
9 changed files with 17 additions and 15 deletions

View File

@ -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]

View File

@ -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]

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 ) &amp;&amp; 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"/>

View File

@ -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 ) &amp;&amp; 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"/>

View File

@ -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{