Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Added test for assertion with comma

Commit
51c143b2c61ba4d7124e0e58a07d8b7db5965e4c
Author
Phil Nash ·
Parents
d17d94e45d32

Files · Download .tar.gz

Changes

 projects/SelfTest/Baselines/console.std.approved.txt |  4 ++--
 projects/SelfTest/Baselines/console.sw.approved.txt  | 16 ++++++++++++++--
 projects/SelfTest/Baselines/junit.sw.approved.txt    |  3 ++-
 projects/SelfTest/Baselines/xml.sw.approved.txt      | 15 +++++++++++++--
 projects/SelfTest/TrickyTests.cpp                    |  5 +++++
 5 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
index 2e76ce75..b07d6f3a 100644
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ b/projects/SelfTest/Baselines/console.std.approved.txt
@@ -940,6 +940,6 @@ with expansion:
   "first" == "second"
 
 ===============================================================================
-test cases: 168 | 120 passed | 44 failed |  4 failed as expected
-assertions: 968 | 860 passed | 87 failed | 21 failed as expected
+test cases: 169 | 121 passed | 44 failed |  4 failed as expected
+assertions: 969 | 861 passed | 87 failed | 21 failed as expected
 
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index 41693f3a..b62a9a3c 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -8461,6 +8461,18 @@ PASSED:
 with expansion:
   "[\x7F]" == "[\x7F]"
 
+-------------------------------------------------------------------------------
+assertions with commas are allowed
+-------------------------------------------------------------------------------
+TrickyTests.cpp:<line number>
+...............................................................................
+
+TrickyTests.cpp:<line number>:
+PASSED:
+  REQUIRE( std::vector<int>{1, 2} == std::vector<int>{1, 2} )
+with expansion:
+  { 1, 2 } == { 1, 2 }
+
 -------------------------------------------------------------------------------
 atomic if
 -------------------------------------------------------------------------------
@@ -9480,6 +9492,6 @@ MiscTests.cpp:<line number>:
 PASSED:
 
 ===============================================================================
-test cases: 168 | 119 passed | 45 failed |  4 failed as expected
-assertions: 970 | 860 passed | 89 failed | 21 failed as expected
+test cases: 169 | 120 passed | 45 failed |  4 failed as expected
+assertions: 971 | 861 passed | 89 failed | 21 failed as expected
 
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
index ee691ce0..fc9528f7 100644
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ b/projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuitesspanner>
-  <testsuite name="<exe-name>" errors="13" failures="77" tests="971" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="13" failures="77" tests="972" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
     <testcase classname="global" name="# A test name that starts with a #" time="{duration}"/>
     <testcase classname="#748 - captures with unexpected exceptions" name="outside assertions" time="{duration}">
       <error type="TEST_CASE">
@@ -608,6 +608,7 @@ ExceptionTests.cpp:<line number>
     <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="global" name="assertions with commas are allowed" time="{duration}"/>
     <testcase classname="global" name="atomic if" time="{duration}"/>
     <testcase classname="global" name="boolean member" time="{duration}"/>
     <testcase classname="global" name="checkedElse" time="{duration}"/>
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
index 1373c6d3..001ad64b 100644
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ b/projects/SelfTest/Baselines/xml.sw.approved.txt
@@ -9085,6 +9085,17 @@ there"
       </Section>
       <OverallResult success="true"/>
     </TestCase>
+    <TestCase name="assertions with commas are allowed" filename="projects/<exe-name>/TrickyTests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/TrickyTests.cpp" >
+        <Original>
+          std::vector&lt;int>{1, 2} == std::vector&lt;int>{1, 2}
+        </Original>
+        <Expanded>
+          { 1, 2 } == { 1, 2 }
+        </Expanded>
+      </Expression>
+      <OverallResult success="true"/>
+    </TestCase>
     <TestCase name="atomic if" tags="[0][failing]" filename="projects/<exe-name>/MiscTests.cpp" >
       <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/MiscTests.cpp" >
         <Original>
@@ -10128,7 +10139,7 @@ spanner      <OverallResult success="true"/>
       </Section>
       <OverallResult success="true"/>
     </TestCase>
-    <OverallResults successes="860" failures="90" expectedFailures="21"/>
+    <OverallResults successes="861" failures="90" expectedFailures="21"/>
   </Group>
-  <OverallResults successes="860" failures="89" expectedFailures="21"/>
+  <OverallResults successes="861" failures="89" expectedFailures="21"/>
 </Catch>
diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp
index 05053fe3..129fc2a2 100644
--- a/projects/SelfTest/TrickyTests.cpp
+++ b/projects/SelfTest/TrickyTests.cpp
@@ -398,3 +398,8 @@ TEST_CASE( "has printf", "" ) {
     // This can cause problems as, currently, stdout itself is not redirect - only the cout (and cerr) buffer
     printf( "spanner" );
 }
+
+TEST_CASE( "assertions with commas are allowed" ) {
+
+    REQUIRE( std::vector<int>{1, 2} == std::vector<int>{1, 2} );
+}