mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Added tests for toString<std::tuple<>> and rebased
This commit is contained in:
		@@ -786,6 +786,6 @@ with expansion:
 | 
			
		||||
  "first" == "second"
 | 
			
		||||
 | 
			
		||||
===============================================================================
 | 
			
		||||
test cases: 149 | 110 passed | 38 failed |  1 failed as expected
 | 
			
		||||
assertions: 753 | 661 passed | 79 failed | 13 failed as expected
 | 
			
		||||
test cases: 155 | 116 passed | 38 failed |  1 failed as expected
 | 
			
		||||
assertions: 761 | 669 passed | 79 failed | 13 failed as expected
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7373,6 +7373,96 @@ PASSED:
 | 
			
		||||
with expansion:
 | 
			
		||||
  true == true
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
tuple<>
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
ToStringTuple.cpp:<line number>
 | 
			
		||||
...............................................................................
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ }" == Catch::toString(type{}) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ }" == "{ }"
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ }" == Catch::toString(value) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ }" == "{ }"
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
tuple<int>
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
ToStringTuple.cpp:<line number>
 | 
			
		||||
...............................................................................
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ 0 }" == Catch::toString(type{0}) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ 0 }" == "{ 0 }"
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
tuple<float,int>
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
ToStringTuple.cpp:<line number>
 | 
			
		||||
...............................................................................
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "1.2f" == Catch::toString(float(1.2)) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "1.2f" == "1.2f"
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ 1.2f, 0 }" == Catch::toString(type{1.2,0}) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ 1.2f, 0 }" == "{ 1.2f, 0 }"
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
tuple<string,string>
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
ToStringTuple.cpp:<line number>
 | 
			
		||||
...............................................................................
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ \"hello\", \"world\" }" == Catch::toString(type{"hello","world"}) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ "hello", "world" }"
 | 
			
		||||
  ==
 | 
			
		||||
  "{ "hello", "world" }"
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
tuple<tuple<int>,tuple<>,float>
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
ToStringTuple.cpp:<line number>
 | 
			
		||||
...............................................................................
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ { 42 }, { }, 1.2f }" == Catch::toString(value) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ { 42 }, { }, 1.2f }"
 | 
			
		||||
  ==
 | 
			
		||||
  "{ { 42 }, { }, 1.2f }"
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
tuple<nullptr,int,const char *>
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
ToStringTuple.cpp:<line number>
 | 
			
		||||
...............................................................................
 | 
			
		||||
 | 
			
		||||
ToStringTuple.cpp:<line number>:
 | 
			
		||||
PASSED:
 | 
			
		||||
  CHECK( "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value) )
 | 
			
		||||
with expansion:
 | 
			
		||||
  "{ nullptr, 42, "Catch me" }"
 | 
			
		||||
  ==
 | 
			
		||||
  "{ nullptr, 42, "Catch me" }"
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
Tag alias can be registered against tag patterns
 | 
			
		||||
  The same tag alias can only be registered once
 | 
			
		||||
@@ -7816,6 +7906,6 @@ with expansion:
 | 
			
		||||
  true
 | 
			
		||||
 | 
			
		||||
===============================================================================
 | 
			
		||||
test cases: 149 |  94 passed | 54 failed |  1 failed as expected
 | 
			
		||||
assertions: 773 | 661 passed | 99 failed | 13 failed as expected
 | 
			
		||||
test cases: 155 | 100 passed | 54 failed |  1 failed as expected
 | 
			
		||||
assertions: 781 | 669 passed | 99 failed | 13 failed as expected
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<testsuites>
 | 
			
		||||
  <testsuite name="all tests" errors="12" failures="87" tests="773" hostname="tbd" time="{duration}" timestamp="tbd">
 | 
			
		||||
  <testsuite name="all tests" errors="12" failures="87" tests="781" 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}"/>
 | 
			
		||||
@@ -585,6 +585,12 @@ TrickyTests.cpp:<line number>
 | 
			
		||||
    <testcase classname="Parse test names and tags" name="empty tag" time="{duration}"/>
 | 
			
		||||
    <testcase classname="Parse test names and tags" name="empty quoted name" time="{duration}"/>
 | 
			
		||||
    <testcase classname="Parse test names and tags" name="quoted string followed by tag exclusion" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="tuple<>" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="tuple<int>" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="tuple<float,int>" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="tuple<string,string>" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="tuple<tuple<int>,tuple<>,float>" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="tuple<nullptr,int,const char *>" time="{duration}"/>
 | 
			
		||||
    <testcase classname="Tag alias can be registered against tag patterns" name="The same tag alias can only be registered once" time="{duration}"/>
 | 
			
		||||
    <testcase classname="Tag alias can be registered against tag patterns" name="Tag aliases must be of the form [@name]" time="{duration}"/>
 | 
			
		||||
    <testcase classname="global" name="Anonymous test case 1" time="{duration}"/>
 | 
			
		||||
 
 | 
			
		||||
@@ -7656,6 +7656,94 @@ there"
 | 
			
		||||
      </Section>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="tuple<>">
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ }" == Catch::toString(type{})
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ }" == "{ }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ }" == Catch::toString(value)
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ }" == "{ }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="tuple<int>">
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ 0 }" == Catch::toString(type{0})
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ 0 }" == "{ 0 }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="tuple<float,int>">
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "1.2f" == Catch::toString(float(1.2))
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "1.2f" == "1.2f"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ 1.2f, 0 }" == Catch::toString(type{1.2,0})
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ 1.2f, 0 }" == "{ 1.2f, 0 }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="tuple<string,string>">
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ \"hello\", \"world\" }" == Catch::toString(type{"hello","world"})
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ "hello", "world" }"
 | 
			
		||||
==
 | 
			
		||||
"{ "hello", "world" }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="tuple<tuple<int>,tuple<>,float>">
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ { 42 }, { }, 1.2f }" == Catch::toString(value)
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ { 42 }, { }, 1.2f }"
 | 
			
		||||
==
 | 
			
		||||
"{ { 42 }, { }, 1.2f }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="tuple<nullptr,int,const char *>">
 | 
			
		||||
      <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
 | 
			
		||||
        <Original>
 | 
			
		||||
          "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value)
 | 
			
		||||
        </Original>
 | 
			
		||||
        <Expanded>
 | 
			
		||||
          "{ nullptr, 42, "Catch me" }"
 | 
			
		||||
==
 | 
			
		||||
"{ nullptr, 42, "Catch me" }"
 | 
			
		||||
        </Expanded>
 | 
			
		||||
      </Expression>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <TestCase name="Tag alias can be registered against tag patterns">
 | 
			
		||||
      <Section name="The same tag alias can only be registered once">
 | 
			
		||||
        <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
 | 
			
		||||
@@ -8086,7 +8174,7 @@ there"
 | 
			
		||||
      </Section>
 | 
			
		||||
      <OverallResult success="true"/>
 | 
			
		||||
    </TestCase>
 | 
			
		||||
    <OverallResults successes="661" failures="99" expectedFailures="13"/>
 | 
			
		||||
    <OverallResults successes="669" failures="99" expectedFailures="13"/>
 | 
			
		||||
  </Group>
 | 
			
		||||
  <OverallResults successes="661" failures="99" expectedFailures="13"/>
 | 
			
		||||
  <OverallResults successes="669" failures="99" expectedFailures="13"/>
 | 
			
		||||
</Catch>
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,7 @@
 | 
			
		||||
		266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266ECD73170F3C620030D735 /* BDDTests.cpp */; };
 | 
			
		||||
		26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26711C8D195D465C0033EDA2 /* TagAliasTests.cpp */; };
 | 
			
		||||
		26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; };
 | 
			
		||||
		2691574C1A532A280054F1ED /* ToStringTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2691574B1A532A280054F1ED /* ToStringTuple.cpp */; };
 | 
			
		||||
		26948286179A9AB900ED166E /* SectionTrackerTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26948284179A9AB900ED166E /* SectionTrackerTests.cpp */; };
 | 
			
		||||
		2694A1FD16A0000E004816E3 /* catch_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_text.cpp */; };
 | 
			
		||||
		26E1B7D319213BC900812682 /* CmdLineTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E1B7D119213BC900812682 /* CmdLineTests.cpp */; };
 | 
			
		||||
@@ -97,6 +98,7 @@
 | 
			
		||||
		26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = "<group>"; };
 | 
			
		||||
		268F47B018A93F7800D8C14F /* catch_clara.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_clara.h; sourceTree = "<group>"; };
 | 
			
		||||
		2691574A1A4480C50054F1ED /* catch_reporter_teamcity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_teamcity.hpp; sourceTree = "<group>"; };
 | 
			
		||||
		2691574B1A532A280054F1ED /* ToStringTuple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToStringTuple.cpp; path = ../../../SelfTest/ToStringTuple.cpp; sourceTree = "<group>"; };
 | 
			
		||||
		26926E8318D7777D004E10F2 /* clara.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = clara.h; path = ../../../../include/external/clara.h; sourceTree = "<group>"; };
 | 
			
		||||
		26926E8418D77809004E10F2 /* tbc_text_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tbc_text_format.h; path = ../../../../include/external/tbc_text_format.h; sourceTree = "<group>"; };
 | 
			
		||||
		26948284179A9AB900ED166E /* SectionTrackerTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionTrackerTests.cpp; path = ../../../SelfTest/SectionTrackerTests.cpp; sourceTree = "<group>"; };
 | 
			
		||||
@@ -256,6 +258,7 @@
 | 
			
		||||
		4A6D0C40149B3DAB00DB3EAA /* Tests */ = {
 | 
			
		||||
			isa = PBXGroup;
 | 
			
		||||
			children = (
 | 
			
		||||
				2691574B1A532A280054F1ED /* ToStringTuple.cpp */,
 | 
			
		||||
				263F7A4819B6FE1E009474C2 /* ToStringPair.cpp */,
 | 
			
		||||
				263F7A4919B6FE1E009474C2 /* ToStringVector.cpp */,
 | 
			
		||||
				263F7A4A19B6FE1E009474C2 /* ToStringWhich.cpp */,
 | 
			
		||||
@@ -558,6 +561,7 @@
 | 
			
		||||
				4A45DA2D16161FA2004F8D6B /* catch_interfaces_capture.cpp in Sources */,
 | 
			
		||||
				4A45DA3116161FFC004F8D6B /* catch_interfaces_reporter.cpp in Sources */,
 | 
			
		||||
				4A45DA3316162047004F8D6B /* catch_interfaces_exception.cpp in Sources */,
 | 
			
		||||
				2691574C1A532A280054F1ED /* ToStringTuple.cpp in Sources */,
 | 
			
		||||
				26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */,
 | 
			
		||||
				4A45DA3516162071004F8D6B /* catch_interfaces_runner.cpp in Sources */,
 | 
			
		||||
				4AB3D99D1616216500C9A0F8 /* catch_interfaces_testcase.cpp in Sources */,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user