mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-18 19:05:40 +02: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:
@@ -2108,6 +2108,38 @@ Tricky.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
0 == 0
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
CAPTURE can deal with complex expressions
|
||||
-------------------------------------------------------------------------------
|
||||
Message.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Message.tests.cpp:<line number>: PASSED:
|
||||
with messages:
|
||||
a := 1
|
||||
b := 2
|
||||
c := 3
|
||||
a + b := 3
|
||||
a+b := 3
|
||||
c > b := true
|
||||
a == 1 := true
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
CAPTURE can deal with complex expressions involving commas
|
||||
-------------------------------------------------------------------------------
|
||||
Message.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Message.tests.cpp:<line number>: PASSED:
|
||||
with messages:
|
||||
std::vector<int>{1, 2, 3}[0, 1, 2] := 3
|
||||
std::vector<int>{1, 2, 3}[(0, 1)] := 2
|
||||
std::vector<int>{1, 2, 3}[0] := 1
|
||||
(helper_1436<int, int>{12, -12}) := { 12, -12 }
|
||||
(helper_1436<int, int>(-12, 12)) := { -12, 12 }
|
||||
(1, 2) := 2
|
||||
(2, 3) := 3
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Capture and info messages
|
||||
Capture should stringify like assertions
|
||||
@@ -10432,6 +10464,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 226 | 157 passed | 65 failed | 4 failed as expected
|
||||
assertions: 1322 | 1176 passed | 125 failed | 21 failed as expected
|
||||
test cases: 228 | 159 passed | 65 failed | 4 failed as expected
|
||||
assertions: 1324 | 1178 passed | 125 failed | 21 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user