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

Rebased with string conversion tests

Commit
bb8c1fb17f5d0369c2a49505ca4ea0f77d0f636d
Author
Phil Nash ·
Parents
c659e0fd3dad

Files · Download .tar.gz

Changes

 .../SelfTest/Baselines/console.std.approved.txt    |   2 +-
 .../SelfTest/Baselines/console.sw.approved.txt     | 122 +++++++++++++++++-
 projects/SelfTest/Baselines/junit.sw.approved.txt  |   8 +-
 projects/SelfTest/Baselines/xml.sw.approved.txt    | 136 ++++++++++++++++++++-
 4 files changed, 263 insertions(+), 5 deletions(-)

diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
index f0a61f56..2618ba11 100644
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ b/projects/SelfTest/Baselines/console.std.approved.txt
@@ -1021,5 +1021,5 @@ with expansion:
 
 ===============================================================================
 test cases: 183 | 132 passed | 47 failed |  4 failed as expected
-assertions: 896 | 779 passed | 96 failed | 21 failed as expected
+assertions: 908 | 791 passed | 96 failed | 21 failed as expected
 
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index db766fab..f3d8d63d 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -4829,6 +4829,126 @@ PASSED:
 with expansion:
   "hot potato" == "hot potato"
 
+-------------------------------------------------------------------------------
+StringRef
+  from std::string
+  implicitly constructed
+-------------------------------------------------------------------------------
+StringRef.tests.cpp:<line number>
+...............................................................................
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( sr == "a standard string" )
+with expansion:
+  {?} == "a standard string"
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( sr.size() == stdStr.size() )
+with expansion:
+  17 == 17
+
+-------------------------------------------------------------------------------
+StringRef
+  from std::string
+  explicitly constructed
+-------------------------------------------------------------------------------
+StringRef.tests.cpp:<line number>
+...............................................................................
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( sr == "a standard string" )
+with expansion:
+  {?} == "a standard string"
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( sr.size() == stdStr.size() )
+with expansion:
+  17 == 17
+
+-------------------------------------------------------------------------------
+StringRef
+  from std::string
+  assigned
+-------------------------------------------------------------------------------
+StringRef.tests.cpp:<line number>
+...............................................................................
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( sr == "a standard string" )
+with expansion:
+  {?} == "a standard string"
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( sr.size() == stdStr.size() )
+with expansion:
+  17 == 17
+
+-------------------------------------------------------------------------------
+StringRef
+  to std::string
+  implicitly constructed
+-------------------------------------------------------------------------------
+StringRef.tests.cpp:<line number>
+...............................................................................
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( stdStr == "a stringref" )
+with expansion:
+  "a stringref" == "a stringref"
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( stdStr.size() == sr.size() )
+with expansion:
+  11 == 11
+
+-------------------------------------------------------------------------------
+StringRef
+  to std::string
+  explicitly constructed
+-------------------------------------------------------------------------------
+StringRef.tests.cpp:<line number>
+...............................................................................
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( stdStr == "a stringref" )
+with expansion:
+  "a stringref" == "a stringref"
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( stdStr.size() == sr.size() )
+with expansion:
+  11 == 11
+
+-------------------------------------------------------------------------------
+StringRef
+  to std::string
+  assigned
+-------------------------------------------------------------------------------
+StringRef.tests.cpp:<line number>
+...............................................................................
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( stdStr == "a stringref" )
+with expansion:
+  "a stringref" == "a stringref"
+
+StringRef.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( stdStr.size() == sr.size() )
+with expansion:
+  11 == 11
+
 -------------------------------------------------------------------------------
 Tabs and newlines show in output
 -------------------------------------------------------------------------------
@@ -7639,5 +7759,5 @@ PASSED:
 
 ===============================================================================
 test cases: 183 | 130 passed |  49 failed |  4 failed as expected
-assertions: 901 | 779 passed | 101 failed | 21 failed as expected
+assertions: 913 | 791 passed | 101 failed | 21 failed as expected
 
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
index b99c0964..390e7297 100644
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ b/projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuitesloose text artifact
 >
-  <testsuite name="<exe-name>" errors="15" failures="87" tests="902" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="15" failures="87" tests="914" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
     <testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
     <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}">
       <error type="TEST_CASE">
@@ -527,6 +527,12 @@ MatchersTests.cpp:<line number>
     <testcase classname="<exe-name>.global" name="StringRef/Comparisons" time="{duration}"/>
     <testcase classname="<exe-name>.global" name="StringRef/From string/Copied" time="{duration}"/>
     <testcase classname="<exe-name>.global" name="StringRef/From string/Moved" time="{duration}"/>
+    <testcase classname="<exe-name>.global" name="StringRef/from std::string/implicitly constructed" time="{duration}"/>
+    <testcase classname="<exe-name>.global" name="StringRef/from std::string/explicitly constructed" time="{duration}"/>
+    <testcase classname="<exe-name>.global" name="StringRef/from std::string/assigned" time="{duration}"/>
+    <testcase classname="<exe-name>.global" name="StringRef/to std::string/implicitly constructed" time="{duration}"/>
+    <testcase classname="<exe-name>.global" name="StringRef/to std::string/explicitly constructed" time="{duration}"/>
+    <testcase classname="<exe-name>.global" name="StringRef/to std::string/assigned" time="{duration}"/>
     <testcase classname="<exe-name>.global" name="Tabs and newlines show in output" time="{duration}">
       <failure message="&quot;if ($b == 10) {
 		$a	= 20;
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
index 5aebbe28..7ad54363 100644
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ b/projects/SelfTest/Baselines/xml.sw.approved.txt
@@ -5507,6 +5507,138 @@ Message from section two
         </Section>
         <OverallResults successes="4" failures="0" expectedFailures="0"/>
       </Section>
+      <Section name="from std::string" filename="projects/<exe-name>/StringRef.tests.cpp" >
+        <Section name="implicitly constructed" filename="projects/<exe-name>/StringRef.tests.cpp" >
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              sr == "a standard string"
+            </Original>
+            <Expanded>
+              {?} == "a standard string"
+            </Expanded>
+          </Expression>
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              sr.size() == stdStr.size()
+            </Original>
+            <Expanded>
+              17 == 17
+            </Expanded>
+          </Expression>
+          <OverallResults successes="2" failures="0" expectedFailures="0"/>
+        </Section>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="from std::string" filename="projects/<exe-name>/StringRef.tests.cpp" >
+        <Section name="explicitly constructed" filename="projects/<exe-name>/StringRef.tests.cpp" >
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              sr == "a standard string"
+            </Original>
+            <Expanded>
+              {?} == "a standard string"
+            </Expanded>
+          </Expression>
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              sr.size() == stdStr.size()
+            </Original>
+            <Expanded>
+              17 == 17
+            </Expanded>
+          </Expression>
+          <OverallResults successes="2" failures="0" expectedFailures="0"/>
+        </Section>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="from std::string" filename="projects/<exe-name>/StringRef.tests.cpp" >
+        <Section name="assigned" filename="projects/<exe-name>/StringRef.tests.cpp" >
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              sr == "a standard string"
+            </Original>
+            <Expanded>
+              {?} == "a standard string"
+            </Expanded>
+          </Expression>
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              sr.size() == stdStr.size()
+            </Original>
+            <Expanded>
+              17 == 17
+            </Expanded>
+          </Expression>
+          <OverallResults successes="2" failures="0" expectedFailures="0"/>
+        </Section>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="to std::string" filename="projects/<exe-name>/StringRef.tests.cpp" >
+        <Section name="implicitly constructed" filename="projects/<exe-name>/StringRef.tests.cpp" >
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              stdStr == "a stringref"
+            </Original>
+            <Expanded>
+              "a stringref" == "a stringref"
+            </Expanded>
+          </Expression>
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              stdStr.size() == sr.size()
+            </Original>
+            <Expanded>
+              11 == 11
+            </Expanded>
+          </Expression>
+          <OverallResults successes="2" failures="0" expectedFailures="0"/>
+        </Section>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="to std::string" filename="projects/<exe-name>/StringRef.tests.cpp" >
+        <Section name="explicitly constructed" filename="projects/<exe-name>/StringRef.tests.cpp" >
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              stdStr == "a stringref"
+            </Original>
+            <Expanded>
+              "a stringref" == "a stringref"
+            </Expanded>
+          </Expression>
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              stdStr.size() == sr.size()
+            </Original>
+            <Expanded>
+              11 == 11
+            </Expanded>
+          </Expression>
+          <OverallResults successes="2" failures="0" expectedFailures="0"/>
+        </Section>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="to std::string" filename="projects/<exe-name>/StringRef.tests.cpp" >
+        <Section name="assigned" filename="projects/<exe-name>/StringRef.tests.cpp" >
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              stdStr == "a stringref"
+            </Original>
+            <Expanded>
+              "a stringref" == "a stringref"
+            </Expanded>
+          </Expression>
+          <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/StringRef.tests.cpp" >
+            <Original>
+              stdStr.size() == sr.size()
+            </Original>
+            <Expanded>
+              11 == 11
+            </Expanded>
+          </Expression>
+          <OverallResults successes="2" failures="0" expectedFailures="0"/>
+        </Section>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
       <OverallResult success="true"/>
     </TestCase>
     <TestCase name="Tabs and newlines show in output" tags="[.][failing][hide][whitespace]" filename="projects/<exe-name>/MiscTests.cpp" >
@@ -8460,7 +8592,7 @@ loose text artifact
       </Section>
       <OverallResult success="true"/>
     </TestCase>
-    <OverallResults successes="779" failures="102" expectedFailures="21"/>
+    <OverallResults successes="791" failures="102" expectedFailures="21"/>
   </Group>
-  <OverallResults successes="779" failures="101" expectedFailures="21"/>
+  <OverallResults successes="791" failures="101" expectedFailures="21"/>
 </Catch>