Start fixing up Matchers: namespaces, composition ops

This commit also forbids composing lvalues of composed matchers, as
per previous deprecation notice. I do not expect this to be contentious
in practice, because there was a bug in that usage for years, and
nobody complained.
This commit is contained in:
Martin Hořeňovský
2020-02-18 23:31:16 +01:00
parent a1be19aa1b
commit cf6575576f
22 changed files with 230 additions and 296 deletions

View File

@@ -299,7 +299,7 @@ Nor would this
</Expression>
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
"aaa", Catch::EndsWith("aaa")
"aaa", Catch::Matchers::EndsWith("aaa")
</Original>
<Expanded>
"aaa" ends with: "aaa"
@@ -3011,25 +3011,6 @@ Nor would this
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Composed matchers are distinct" tags="[composed][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
testStringForMatching2(), !composed1
</Original>
<Expanded>
"some completely different text that contains one common word" not ( contains: "string" or contains: "random" )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
testStringForMatching2(), composed2
</Original>
<Expanded>
"some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" )
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Contains string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
@@ -16273,7 +16254,7 @@ loose text artifact
<TestCase name="shortened hide tags are split apart" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" >
<Original>
tags, Catch::VectorContains("magic-tag"_catch_sr) &amp;&amp; Catch::VectorContains("."_catch_sr)
tags, VectorContains("magic-tag"_catch_sr) &amp;&amp; VectorContains("."_catch_sr)
</Original>
<Expanded>
{ ., magic-tag } ( Contains: magic-tag and Contains: . )
@@ -17283,7 +17264,7 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="1689" failures="149" expectedFailures="21"/>
<OverallResults successes="1687" failures="149" expectedFailures="21"/>
</Group>
<OverallResults successes="1689" failures="148" expectedFailures="21"/>
<OverallResults successes="1687" failures="148" expectedFailures="21"/>
</Catch>