mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-05 06:29:32 +01:00
Fix CAPTURE macro for nontrivial uses
The previous implemetation was just plain broken for most of possible uses, the new one should work (even though it is ugly as all hell, and should be improved ASAP). Fixes #1436
This commit is contained in:
@@ -1986,6 +1986,54 @@
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||
<Info>
|
||||
a := 1
|
||||
</Info>
|
||||
<Info>
|
||||
b := 2
|
||||
</Info>
|
||||
<Info>
|
||||
c := 3
|
||||
</Info>
|
||||
<Info>
|
||||
a + b := 3
|
||||
</Info>
|
||||
<Info>
|
||||
a+b := 3
|
||||
</Info>
|
||||
<Info>
|
||||
c > b := true
|
||||
</Info>
|
||||
<Info>
|
||||
a == 1 := true
|
||||
</Info>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="CAPTURE can deal with complex expressions involving commas" tags="[capture][messages]" filename="projects/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||
<Info>
|
||||
std::vector<int>{1, 2, 3}[0, 1, 2] := 3
|
||||
</Info>
|
||||
<Info>
|
||||
std::vector<int>{1, 2, 3}[(0, 1)] := 2
|
||||
</Info>
|
||||
<Info>
|
||||
std::vector<int>{1, 2, 3}[0] := 1
|
||||
</Info>
|
||||
<Info>
|
||||
(helper_1436<int, int>{12, -12}) := { 12, -12 }
|
||||
</Info>
|
||||
<Info>
|
||||
(helper_1436<int, int>(-12, 12)) := { -12, 12 }
|
||||
</Info>
|
||||
<Info>
|
||||
(1, 2) := 2
|
||||
</Info>
|
||||
<Info>
|
||||
(2, 3) := 3
|
||||
</Info>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="Capture and info messages" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
|
||||
<Section name="Capture should stringify like assertions" filename="projects/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" >
|
||||
<Info>
|
||||
@@ -12051,7 +12099,7 @@ loose text artifact
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="1176" failures="126" expectedFailures="21"/>
|
||||
<OverallResults successes="1178" failures="126" expectedFailures="21"/>
|
||||
</Group>
|
||||
<OverallResults successes="1176" failures="125" expectedFailures="21"/>
|
||||
<OverallResults successes="1178" failures="125" expectedFailures="21"/>
|
||||
</Catch>
|
||||
|
||||
Reference in New Issue
Block a user