Add more tests for test spec parser

Originally the tests were from #1912, but as it turned out, the issue
was somewhere else. Still, the inputs provided were interesting, so
they are now part of our test suite.
This commit is contained in:
Martin Hořeňovský
2020-04-17 21:16:18 +02:00
parent bbbc7a0d7f
commit dd35430a2b
11 changed files with 156 additions and 10 deletions

View File

@@ -218,6 +218,40 @@ CmdLine.tests.cpp:<line number>: PASSED:
with expansion:
!false
-------------------------------------------------------------------------------
#1912 -- test spec parser handles escaping
Various parentheses
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( spec.matches(*fakeTestCase(R"(spec {a} char)")) )
with expansion:
true
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( spec.matches(*fakeTestCase(R"(spec [a] char)")) )
with expansion:
true
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( spec.matches(*fakeTestCase("differs but has similar tag", "[a]")) )
with expansion:
!false
-------------------------------------------------------------------------------
#1912 -- test spec parser handles escaping
backslash in test name
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( spec.matches(*fakeTestCase(R"(spec \ char)")) )
with expansion:
true
-------------------------------------------------------------------------------
#748 - captures with unexpected exceptions
outside assertions
@@ -398,6 +432,6 @@ Condition.tests.cpp:<line number>: FAILED:
CHECK( true != true )
===============================================================================
test cases: 21 | 16 passed | 3 failed | 2 failed as expected
assertions: 46 | 39 passed | 4 failed | 3 failed as expected
test cases: 22 | 17 passed | 3 failed | 2 failed as expected
assertions: 50 | 43 passed | 4 failed | 3 failed as expected