Added test for invisibles

This commit is contained in:
Phil Nash 2014-04-23 07:07:27 +01:00
parent 328a469c03
commit 31caba4f73
5 changed files with 80 additions and 5 deletions

View File

@ -702,6 +702,24 @@ MiscTests.cpp:<line number>: FAILED:
explicitly with message:
to infinity and beyond
-------------------------------------------------------------------------------
Tabs and newlines show in output
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>: 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)

View File

@ -3537,6 +3537,24 @@ MiscTests.cpp:<line number>
MiscTests.cpp:<line number>:
PASSED:
-------------------------------------------------------------------------------
Tabs and newlines show in output
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>: 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)

View File

@ -1,5 +1,5 @@
<testsuites>
<testsuite name="~_" errors="12" failures="98" tests="646" hostname="tbd" time="{duration}" timestamp="tbd">
<testsuite name="~_" errors="12" failures="99" tests="647" hostname="tbd" time="{duration}" timestamp="tbd">
<testcase classname="global" name="Some simple comparisons between doubles" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with different epsilons" time="{duration}"/>
<testcase classname="global" name="Approximate comparisons with floats" time="{duration}"/>
@ -434,6 +434,18 @@ MiscTests.cpp:<line number>
</testcase>
<testcase classname="A couple of nested sections followed by a failure" name="Outer/Inner" time="{duration}"/>
<testcase classname="global" name="not allowed" time="{duration}"/>
<testcase classname="global" name="Tabs and newlines show in output" time="{duration}">
<failure message="&quot;if ($b == 10) {
$a = 20;
}&quot;
==
&quot;if ($b == 10) {
$a = 20;
}
&quot;" type="CHECK">
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="Process can be configured on command line" name="default - no arguments" time="{duration}"/>
<testcase classname="Process can be configured on command line" name="test lists/1 test" time="{duration}"/>
<testcase classname="Process can be configured on command line" name="test lists/Specify one test case exclusion using exclude:" time="{duration}"/>

View File

@ -3613,6 +3613,24 @@
<TestCase name="not allowed">
<OverallResult success="true"/>
</TestCase>
<TestCase name="Tabs and newlines show in output">
<Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/MiscTests.cpp" >
<Original>
s1 == s2
</Original>
<Expanded>
&quot;if ($b == 10) {
$a = 20;
}&quot;
==
&quot;if ($b == 10) {
$a = 20;
}
&quot;
</Expanded>
</Expression>
<OverallResult success="false"/>
</TestCase>
<TestCase name="Process can be configured on command line">
<Section name="default - no arguments">
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TestMain.cpp" >
@ -6863,7 +6881,7 @@ there&quot;
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="536" failures="110"/>
<OverallResults successes="536" failures="111"/>
</Group>
<OverallResults successes="536" failures="110"/>
<OverallResults successes="536" failures="111"/>
</Catch>

View File

@ -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 );
}