Update outdated tests for stringifying characters

Previously the tests relied purely on output changes in approvals.
Now the stringification output is checked directly as part of the
unit tests.
This commit is contained in:
Martin Hořeňovský
2024-03-01 15:09:06 +01:00
parent fb51116d5b
commit c3fd4eb17e
12 changed files with 153 additions and 292 deletions

View File

@@ -2904,24 +2904,24 @@ ToStringGeneral.tests.cpp:<line number>
...............................................................................
ToStringGeneral.tests.cpp:<line number>: PASSED:
CHECK( tab == '\t' )
CHECK( ::Catch::Detail::stringify('\t') == "'\\t'" )
with expansion:
'\t' == '\t'
"'\t'" == "'\t'"
ToStringGeneral.tests.cpp:<line number>: PASSED:
CHECK( newline == '\n' )
CHECK( ::Catch::Detail::stringify('\n') == "'\\n'" )
with expansion:
'\n' == '\n'
"'\n'" == "'\n'"
ToStringGeneral.tests.cpp:<line number>: PASSED:
CHECK( carr_return == '\r' )
CHECK( ::Catch::Detail::stringify('\r') == "'\\r'" )
with expansion:
'\r' == '\r'
"'\r'" == "'\r'"
ToStringGeneral.tests.cpp:<line number>: PASSED:
CHECK( form_feed == '\f' )
CHECK( ::Catch::Detail::stringify('\f') == "'\\f'" )
with expansion:
'\f' == '\f'
"'\f'" == "'\f'"
-------------------------------------------------------------------------------
Character pretty printing
@@ -2931,29 +2931,19 @@ ToStringGeneral.tests.cpp:<line number>
...............................................................................
ToStringGeneral.tests.cpp:<line number>: PASSED:
CHECK( space == ' ' )
CHECK( ::Catch::Detail::stringify( ' ' ) == "' '" )
with expansion:
' ' == ' '
"' '" == "' '"
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == chars[i] )
CHECK( ::Catch::Detail::stringify( 'A' ) == "'A'" )
with expansion:
'a' == 'a'
"'A'" == "'A'"
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == chars[i] )
CHECK( ::Catch::Detail::stringify( 'z' ) == "'z'" )
with expansion:
'z' == 'z'
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == chars[i] )
with expansion:
'A' == 'A'
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == chars[i] )
with expansion:
'Z' == 'Z'
"'z'" == "'z'"
-------------------------------------------------------------------------------
Character pretty printing
@@ -2963,29 +2953,19 @@ ToStringGeneral.tests.cpp:<line number>
...............................................................................
ToStringGeneral.tests.cpp:<line number>: PASSED:
CHECK( null_terminator == '\0' )
CHECK( ::Catch::Detail::stringify( '\0' ) == "0" )
with expansion:
0 == 0
"0" == "0"
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == i )
CHECK( ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" )
with expansion:
2 == 2
"2" == "2"
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == i )
CHECK( ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" )
with expansion:
3 == 3
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == i )
with expansion:
4 == 4
ToStringGeneral.tests.cpp:<line number>: PASSED:
REQUIRE( c == i )
with expansion:
5 == 5
"5" == "5"
-------------------------------------------------------------------------------
Clara::Arg supports single-arg parse the way Opt does
@@ -18752,5 +18732,5 @@ Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 417 | 312 passed | 85 failed | 6 skipped | 14 failed as expected
assertions: 2260 | 2079 passed | 146 failed | 35 failed as expected
assertions: 2256 | 2075 passed | 146 failed | 35 failed as expected