mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Rename Contains string matcher builder to ContainsSubstring
The problem with the old name was that it collided with the range matcher `Contains`, and it was not really possible to disambiguate them just with argument types. Closes #2131
This commit is contained in:
@@ -1008,16 +1008,16 @@ Exception.tests.cpp:<line number>
|
||||
<testCase name="Composed matchers shortcircuit/MatchAllOf" duration="{duration}"/>
|
||||
<testCase name="Composed matchers shortcircuit/MatchAnyOf" duration="{duration}"/>
|
||||
<testCase name="Contains string matcher" duration="{duration}">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ))">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ))">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) )
|
||||
CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "not there" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="CHECK_THAT(testStringForMatching(), Contains( "STRING" ))">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), ContainsSubstring( "STRING" ))">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Contains( "STRING" ) )
|
||||
CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "STRING"
|
||||
Matchers.tests.cpp:<line number>
|
||||
@@ -1116,9 +1116,9 @@ Matchers.tests.cpp:<line number>
|
||||
<testCase name="Matchers can be (AnyOf) composed with the || operator" duration="{duration}"/>
|
||||
<testCase name="Matchers can be composed with both && and ||" duration="{duration}"/>
|
||||
<testCase name="Matchers can be composed with both && and || - failing" duration="{duration}">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ))">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ))">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) )
|
||||
CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )
|
||||
Matchers.tests.cpp:<line number>
|
||||
@@ -1126,9 +1126,9 @@ Matchers.tests.cpp:<line number>
|
||||
</testCase>
|
||||
<testCase name="Matchers can be negated (Not) with the ! operator" duration="{duration}"/>
|
||||
<testCase name="Matchers can be negated (Not) with the ! operator - failing" duration="{duration}">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), !Contains( "substring" ))">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), !ContainsSubstring( "substring" ))">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), !Contains( "substring" ) )
|
||||
CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" not contains: "substring"
|
||||
Matchers.tests.cpp:<line number>
|
||||
|
Reference in New Issue
Block a user