mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Fixed Xml encoding
- don't encode apostrophes - only encode quotes in attributes - encode control characters (as in PR #465)
This commit is contained in:
@@ -797,6 +797,6 @@ with expansion:
|
||||
"first" == "second"
|
||||
|
||||
===============================================================================
|
||||
test cases: 157 | 117 passed | 39 failed | 1 failed as expected
|
||||
assertions: 773 | 680 passed | 80 failed | 13 failed as expected
|
||||
test cases: 158 | 118 passed | 39 failed | 1 failed as expected
|
||||
assertions: 783 | 690 passed | 80 failed | 13 failed as expected
|
||||
|
||||
|
@@ -3762,6 +3762,128 @@ PASSED:
|
||||
with expansion:
|
||||
""wide load"" == ""wide load""
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
normal string
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "normal string" ) == "normal string" )
|
||||
with expansion:
|
||||
"normal string" == "normal string"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
empty string
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "" ) == "" )
|
||||
with expansion:
|
||||
"" == ""
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
string with ampersand
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "smith & jones" ) == "smith & jones" )
|
||||
with expansion:
|
||||
"smith & jones" == "smith & jones"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
string with less-than
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "smith < jones" ) == "smith < jones" )
|
||||
with expansion:
|
||||
"smith < jones" == "smith < jones"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
string with greater-than
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "smith > jones" ) == "smith > jones" )
|
||||
with expansion:
|
||||
"smith > jones" == "smith > jones"
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "smith ]]> jones" ) == "smith ]]> jones" )
|
||||
with expansion:
|
||||
"smith ]]> jones"
|
||||
==
|
||||
"smith ]]> jones"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
string with quotes
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( stringWithQuotes ) == stringWithQuotes )
|
||||
with expansion:
|
||||
"don't "quote" me on that"
|
||||
==
|
||||
"don't "quote" me on that"
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't "quote" me on that" )
|
||||
with expansion:
|
||||
"don't "quote" me on that"
|
||||
==
|
||||
"don't "quote" me on that"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
string with control char (1)
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "[\x01]" ) == "[]" )
|
||||
with expansion:
|
||||
"[]" == "[]"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
XmlEncode
|
||||
string with control char (x7F)
|
||||
-------------------------------------------------------------------------------
|
||||
MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( encode( "[\x7F]" ) == "[]" )
|
||||
with expansion:
|
||||
"[]" == "[]"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Process can be configured on command line
|
||||
default - no arguments
|
||||
@@ -8004,6 +8126,6 @@ with expansion:
|
||||
true
|
||||
|
||||
===============================================================================
|
||||
test cases: 157 | 101 passed | 55 failed | 1 failed as expected
|
||||
assertions: 793 | 680 passed | 100 failed | 13 failed as expected
|
||||
test cases: 158 | 102 passed | 55 failed | 1 failed as expected
|
||||
assertions: 803 | 690 passed | 100 failed | 13 failed as expected
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<testsuites>
|
||||
<testsuite name="all tests" errors="12" failures="88" tests="793" hostname="tbd" time="{duration}" timestamp="tbd">
|
||||
<testsuite name="all tests" errors="12" failures="88" tests="803" hostname="tbd" time="{duration}" timestamp="tbd">
|
||||
<testcase classname="global" name="toString(enum)" time="{duration}"/>
|
||||
<testcase classname="global" name="toString(enum w/operator<<)" time="{duration}"/>
|
||||
<testcase classname="global" name="toString(enum class)" time="{duration}"/>
|
||||
@@ -463,6 +463,14 @@ MiscTests.cpp:<line number>
|
||||
<testcase classname="global" name="toString on const wchar_t pointer returns the string contents" time="{duration}"/>
|
||||
<testcase classname="global" name="toString on wchar_t const pointer returns the string contents" time="{duration}"/>
|
||||
<testcase classname="global" name="toString on wchar_t returns the string contents" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="normal string" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="empty string" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="string with ampersand" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="string with less-than" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="string with greater-than" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="string with quotes" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="string with control char (1)" time="{duration}"/>
|
||||
<testcase classname="XmlEncode" name="string with control char (x7F)" time="{duration}"/>
|
||||
<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}"/>
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user