Add more tests for various less common tag-related cases

This commit is contained in:
Martin Hořeňovský
2021-12-27 10:04:48 +01:00
parent 45577a1f4c
commit f00b6e2019
13 changed files with 437 additions and 10 deletions

View File

@@ -3893,6 +3893,15 @@ with expansion:
==
"{** unexpected enum value **}"
-------------------------------------------------------------------------------
Empty tag is not allowed
-------------------------------------------------------------------------------
Tag.tests.cpp:<line number>
...............................................................................
Tag.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( Catch::TestCaseInfo( "", { "fake test name", "[]" }, dummySourceLineInfo ) )
-------------------------------------------------------------------------------
EndsWith string matcher
-------------------------------------------------------------------------------
@@ -8782,6 +8791,27 @@ CmdLine.tests.cpp:<line number>: PASSED:
with expansion:
true
-------------------------------------------------------------------------------
Parsed tags are matched case insensitive
-------------------------------------------------------------------------------
TestSpecParser.tests.cpp:<line number>
...............................................................................
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.hasFilters() )
with expansion:
true
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.getInvalidSpecs().empty() )
with expansion:
true
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.matches( testCase ) )
with expansion:
true
-------------------------------------------------------------------------------
Parsing sharding-related cli flags
shard-count
@@ -8887,6 +8917,60 @@ CmdLine.tests.cpp:<line number>: PASSED:
with expansion:
0 == 0
-------------------------------------------------------------------------------
Parsing tags with non-alphabetical characters is pass-through
-------------------------------------------------------------------------------
TestSpecParser.tests.cpp:<line number>
...............................................................................
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.hasFilters() )
with expansion:
true
with message:
tagString := "[tag with spaces]"
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.getInvalidSpecs().empty() )
with expansion:
true
with message:
tagString := "[tag with spaces]"
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.matches( testCase ) )
with expansion:
true
with message:
tagString := "[tag with spaces]"
-------------------------------------------------------------------------------
Parsing tags with non-alphabetical characters is pass-through
-------------------------------------------------------------------------------
TestSpecParser.tests.cpp:<line number>
...............................................................................
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.hasFilters() )
with expansion:
true
with message:
tagString := "[I said "good day" sir!]"
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.getInvalidSpecs().empty() )
with expansion:
true
with message:
tagString := "[I said "good day" sir!]"
TestSpecParser.tests.cpp:<line number>: PASSED:
REQUIRE( spec.matches( testCase ) )
with expansion:
true
with message:
tagString := "[I said "good day" sir!]"
-------------------------------------------------------------------------------
Parsing warnings
NoAssertions
@@ -11497,6 +11581,22 @@ Tag.tests.cpp:<line number>: PASSED:
Tag.tests.cpp:<line number>: PASSED:
CHECK_THROWS( registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) )
-------------------------------------------------------------------------------
Tags with spaces and non-alphanumerical characters are accepted
-------------------------------------------------------------------------------
Tag.tests.cpp:<line number>
...............................................................................
Tag.tests.cpp:<line number>: PASSED:
REQUIRE( testCase.tags.size() == 2 )
with expansion:
2 == 2
Tag.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) )
with expansion:
{ {?}, {?} } ( Contains: {?} and Contains: {?} )
-------------------------------------------------------------------------------
Template test case method with test types specified inside std::tuple - MyTypes
- 0
@@ -12774,6 +12874,22 @@ Misc.tests.cpp:<line number>: PASSED:
with expansion:
15 >= 15
-------------------------------------------------------------------------------
Test case with identical tags keeps just one
-------------------------------------------------------------------------------
Tag.tests.cpp:<line number>
...............................................................................
Tag.tests.cpp:<line number>: PASSED:
REQUIRE( testCase.tags.size() == 1 )
with expansion:
1 == 1
Tag.tests.cpp:<line number>: PASSED:
REQUIRE( testCase.tags[0] == Tag( "tag1" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Test case with one argument
-------------------------------------------------------------------------------
@@ -17424,6 +17540,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 379 | 286 passed | 86 failed | 7 failed as expected
assertions: 2186 | 2013 passed | 146 failed | 27 failed as expected
test cases: 384 | 291 passed | 86 failed | 7 failed as expected
assertions: 2200 | 2027 passed | 146 failed | 27 failed as expected