diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 74b5ae12..5158f220 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -702,6 +702,24 @@ MiscTests.cpp:: FAILED: explicitly with message: to infinity and beyond +------------------------------------------------------------------------------- +Tabs and newlines show in output +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: FAILED: + CHECK( s1 == s2 ) +with expansion: + "if ($b == 10) { + $a= 20; + }" + == + "if ($b == 10) { + $a = 20; + } + " + hello hello ------------------------------------------------------------------------------- @@ -754,5 +772,5 @@ with expansion: "first" == "second" =============================================================================== -125 test cases - 38 failed (627 assertions - 91 failed) +126 test cases - 39 failed (628 assertions - 92 failed) diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 3a85adf8..978ee1e5 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -3537,6 +3537,24 @@ MiscTests.cpp: MiscTests.cpp:: PASSED: +------------------------------------------------------------------------------- +Tabs and newlines show in output +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: FAILED: + CHECK( s1 == s2 ) +with expansion: + "if ($b == 10) { + $a= 20; + }" + == + "if ($b == 10) { + $a = 20; + } + " + ------------------------------------------------------------------------------- Process can be configured on command line default - no arguments @@ -6650,5 +6668,5 @@ with expansion: true =============================================================================== -125 test cases - 53 failed (646 assertions - 110 failed) +126 test cases - 54 failed (647 assertions - 111 failed) diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 5b36c2bf..481718f0 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ - + @@ -434,6 +434,18 @@ MiscTests.cpp: + + +MiscTests.cpp: + + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 4aec98f8..8905e3df 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -3613,6 +3613,24 @@ + + + + s1 == s2 + + + "if ($b == 10) { + $a = 20; +}" +== +"if ($b == 10) { + $a = 20; +} +" + + + +
@@ -6863,7 +6881,7 @@ there"
- + - + diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index 30d66c3e..8a03c958 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -343,3 +343,12 @@ TEST_CASE("not allowed", "[!throws]") //TEST_CASE( "Is big endian" ) { // CHECK( Catch::Detail::Endianness::which() == Catch::Detail::Endianness::Little ); //} + +TEST_CASE( "Tabs and newlines show in output", "[.][whitespace][failing]" ) { + + // Based on issue #242 + std::string s1 = "if ($b == 10) {\n\t\t$a\t= 20;\n}"; + std::string s2 = "if ($b == 10) {\n\t$a = 20;\n}\n"; + CHECK( s1 == s2 ); +} +