mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	Slight improvement for reporter test
This commit is contained in:
		@@ -1888,10 +1888,10 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("[fa
 | 
				
			|||||||
1 tag
 | 
					1 tag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" contains: "[fakeTag]"
 | 
					" 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
 | 
					  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:
 | 
					Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases:
 | 
				
			||||||
  fake test name
 | 
					  fake test name
 | 
				
			||||||
      [fakeTestTag]
 | 
					      [fakeTestTag]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1881,10 +1881,10 @@ Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("[fa
 | 
				
			|||||||
1 tag
 | 
					1 tag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" contains: "[fakeTag]"
 | 
					" 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
 | 
					  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:
 | 
					Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases:
 | 
				
			||||||
  fake test name
 | 
					  fake test name
 | 
				
			||||||
      [fakeTestTag]
 | 
					      [fakeTestTag]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13420,12 +13420,12 @@ Reporters.tests.cpp:<line number>
 | 
				
			|||||||
...............................................................................
 | 
					...............................................................................
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Reporters.tests.cpp:<line number>: PASSED:
 | 
					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:
 | 
					with expansion:
 | 
				
			||||||
  "Available reporters:
 | 
					  "Available reporters:
 | 
				
			||||||
    fake reporter:  fake description
 | 
					    fake reporter:  fake description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" contains: "fake reporter"
 | 
					" ( contains: "fake reporter" and contains: "fake description" )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------------------------------------------------------------------------
 | 
					-------------------------------------------------------------------------------
 | 
				
			||||||
The default listing implementation write to provided stream
 | 
					The default listing implementation write to provided stream
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13413,12 +13413,12 @@ Reporters.tests.cpp:<line number>
 | 
				
			|||||||
...............................................................................
 | 
					...............................................................................
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Reporters.tests.cpp:<line number>: PASSED:
 | 
					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:
 | 
					with expansion:
 | 
				
			||||||
  "Available reporters:
 | 
					  "Available reporters:
 | 
				
			||||||
    fake reporter:  fake description
 | 
					    fake reporter:  fake description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" contains: "fake reporter"
 | 
					" ( contains: "fake reporter" and contains: "fake description" )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-------------------------------------------------------------------------------
 | 
					-------------------------------------------------------------------------------
 | 
				
			||||||
The default listing implementation write to provided stream
 | 
					The default listing implementation write to provided stream
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3335,7 +3335,7 @@ ok {test-number} - 1 == 2  # TODO
 | 
				
			|||||||
# The default listing implementation write to provided stream
 | 
					# 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]"
 | 
					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
 | 
					# 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
 | 
					# 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" )
 | 
					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
 | 
					# This test 'should' fail but doesn't
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3328,7 +3328,7 @@ ok {test-number} - 1 == 2  # TODO
 | 
				
			|||||||
# The default listing implementation write to provided stream
 | 
					# 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]"
 | 
					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
 | 
					# 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
 | 
					# 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" )
 | 
					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
 | 
					# This test 'should' fail but doesn't
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15727,13 +15727,13 @@ Message from section two
 | 
				
			|||||||
    <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
 | 
					    <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" >
 | 
					      <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
 | 
				
			||||||
        <Original>
 | 
					        <Original>
 | 
				
			||||||
          listingString, ContainsSubstring("fake reporter"s)
 | 
					          listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s )
 | 
				
			||||||
        </Original>
 | 
					        </Original>
 | 
				
			||||||
        <Expanded>
 | 
					        <Expanded>
 | 
				
			||||||
          "Available reporters:
 | 
					          "Available reporters:
 | 
				
			||||||
  fake reporter:  fake description
 | 
					  fake reporter:  fake description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" contains: "fake reporter"
 | 
					" ( contains: "fake reporter" and contains: "fake description" )
 | 
				
			||||||
        </Expanded>
 | 
					        </Expanded>
 | 
				
			||||||
      </Expression>
 | 
					      </Expression>
 | 
				
			||||||
      <OverallResults successes="1" failures="0" expectedFailures="0"/>
 | 
					      <OverallResults successes="1" failures="0" expectedFailures="0"/>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15727,13 +15727,13 @@ Message from section two
 | 
				
			|||||||
    <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
 | 
					    <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" >
 | 
					      <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
 | 
				
			||||||
        <Original>
 | 
					        <Original>
 | 
				
			||||||
          listingString, ContainsSubstring("fake reporter"s)
 | 
					          listingString, ContainsSubstring( "fake reporter"s ) && ContainsSubstring( "fake description"s )
 | 
				
			||||||
        </Original>
 | 
					        </Original>
 | 
				
			||||||
        <Expanded>
 | 
					        <Expanded>
 | 
				
			||||||
          "Available reporters:
 | 
					          "Available reporters:
 | 
				
			||||||
  fake reporter:  fake description
 | 
					  fake reporter:  fake description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" contains: "fake reporter"
 | 
					" ( contains: "fake reporter" and contains: "fake description" )
 | 
				
			||||||
        </Expanded>
 | 
					        </Expanded>
 | 
				
			||||||
      </Expression>
 | 
					      </Expression>
 | 
				
			||||||
      <OverallResults successes="1" failures="0" expectedFailures="0"/>
 | 
					      <OverallResults successes="1" failures="0" expectedFailures="0"/>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,7 +66,9 @@ TEST_CASE( "The default listing implementation write to provided stream",
 | 
				
			|||||||
        Catch::defaultListReporters(sstream.stream(), reporters, Catch::Verbosity::Normal);
 | 
					        Catch::defaultListReporters(sstream.stream(), reporters, Catch::Verbosity::Normal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto listingString = sstream.str();
 | 
					        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" ) {
 | 
					    SECTION( "Listing tests" ) {
 | 
				
			||||||
        Catch::TestCaseInfo fakeInfo{
 | 
					        Catch::TestCaseInfo fakeInfo{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user