diff --git a/docs/matchers.md b/docs/matchers.md index 6fdb15bf..e76d8490 100644 --- a/docs/matchers.md +++ b/docs/matchers.md @@ -35,10 +35,10 @@ operators, that is `&&`, `||`, and `!`, like so: ```cpp using Catch::Matchers::EndsWith; -using Catch::Matchers::Contains; +using Catch::Matchers::ContainsSubstring; REQUIRE_THAT( getSomeString(), - EndsWith("as a service") && Contains("web scale")); + EndsWith("as a service") && ContainsSubstring("web scale")); ``` The example above asserts that the string returned from `getSomeString` @@ -64,7 +64,7 @@ TEST_CASE("Bugs, bugs, bugs", "[Bug]"){ std::string str = "Bugs as a service"; auto match_expression = Catch::Matchers::EndsWith( "as a service" ) || - (Catch::Matchers::StartsWith( "Big data" ) && !Catch::Matchers::Contains( "web scale" ) ); + (Catch::Matchers::StartsWith( "Big data" ) && !Catch::Matchers::ContainsSubstring( "web scale" ) ); REQUIRE_THAT(str, match_expression); } ``` @@ -88,7 +88,7 @@ Out of the box, Catch2 provides the following matchers: Catch2 provides 5 different matchers that work with `std::string`, * `StartsWith(std::string str, CaseSensitive)`, * `EndsWith(std::string str, CaseSensitive)`, -* `Contains(std::string str, CaseSensitive)`, +* `ContainsSubstring(std::string str, CaseSensitive)`, * `Equals(std::string str, CaseSensitive)`, and * `Matches(std::string str, CaseSensitive)`. diff --git a/src/catch2/matchers/catch_matchers_string.cpp b/src/catch2/matchers/catch_matchers_string.cpp index ee082d2c..82a81028 100644 --- a/src/catch2/matchers/catch_matchers_string.cpp +++ b/src/catch2/matchers/catch_matchers_string.cpp @@ -96,7 +96,7 @@ namespace Matchers { StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity ) { return StringEqualsMatcher( CasedString( str, caseSensitivity) ); } - StringContainsMatcher Contains( std::string const& str, CaseSensitive caseSensitivity ) { + StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity ) { return StringContainsMatcher( CasedString( str, caseSensitivity) ); } EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity ) { diff --git a/src/catch2/matchers/catch_matchers_string.hpp b/src/catch2/matchers/catch_matchers_string.hpp index ed2b1f68..0f2d8b87 100644 --- a/src/catch2/matchers/catch_matchers_string.hpp +++ b/src/catch2/matchers/catch_matchers_string.hpp @@ -64,7 +64,7 @@ namespace Matchers { //! Creates matcher that accepts strings that are exactly equal to `str` StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that contain `str` - StringContainsMatcher Contains( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); + StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that _end_ with `str` EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes ); //! Creates matcher that accepts strings that _start_ with `str` diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index 1813ff3c..633400ad 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -447,8 +447,8 @@ Matchers.tests.cpp:: passed: !second.matchCalled for: true Matchers.tests.cpp:: passed: matcher.match( 1 ) for: true Matchers.tests.cpp:: passed: first.matchCalled for: true Matchers.tests.cpp:: passed: !second.matchCalled for: true -Matchers.tests.cpp:: failed: testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) -Matchers.tests.cpp:: failed: testStringForMatching(), Contains( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" +Matchers.tests.cpp:: failed: testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) +Matchers.tests.cpp:: failed: testStringForMatching(), ContainsSubstring( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" Generators.tests.cpp:: passed: elem % 2 == 1 for: 1 == 1 Generators.tests.cpp:: passed: elem % 2 == 1 for: 1 == 1 Generators.tests.cpp:: passed: elem % 2 == 1 for: 1 == 1 @@ -528,8 +528,8 @@ Exception.tests.cpp:: passed: thisThrows(), "expected exception" fo Exception.tests.cpp:: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive) Exception.tests.cpp:: passed: thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected" Exception.tests.cpp:: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception" -Exception.tests.cpp:: passed: thisThrows(), Contains( "except" ) for: "expected exception" contains: "except" -Exception.tests.cpp:: passed: thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) +Exception.tests.cpp:: passed: thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except" +Exception.tests.cpp:: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) Matchers.tests.cpp:: passed: throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what" Matchers.tests.cpp:: passed: throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) for: DerivedException::what not exception message matches "derivedexception::what" Matchers.tests.cpp:: passed: throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) for: SpecialException::what not exception message matches "DerivedException::what" @@ -904,13 +904,13 @@ Approx.tests.cpp:: passed: d <= Approx( 1.23 ) for: 1.23 <= Approx( Approx.tests.cpp:: passed: !(d <= Approx( 1.22 )) for: !(1.23 <= Approx( 1.22 )) Approx.tests.cpp:: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) Misc.tests.cpp:: passed: with 1 message: 'was called' -Matchers.tests.cpp:: passed: testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) -Matchers.tests.cpp:: passed: testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) -Matchers.tests.cpp:: passed: testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) -Matchers.tests.cpp:: passed: testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) -Matchers.tests.cpp:: failed: testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) -Matchers.tests.cpp:: passed: testStringForMatching(), !Contains( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" -Matchers.tests.cpp:: failed: testStringForMatching(), !Contains( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +Matchers.tests.cpp:: passed: testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) +Matchers.tests.cpp:: passed: testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +Matchers.tests.cpp:: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) +Matchers.tests.cpp:: passed: testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +Matchers.tests.cpp:: failed: testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +Matchers.tests.cpp:: passed: testStringForMatching(), !ContainsSubstring( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +Matchers.tests.cpp:: failed: testStringForMatching(), !ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" Exception.tests.cpp:: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" Exception.tests.cpp:: failed: thisThrows(), "should fail" for: "expected exception" equals: "should fail" Generators.tests.cpp:: passed: values > -6 for: 3 > -6 @@ -1216,7 +1216,7 @@ CmdLine.tests.cpp:: passed: cli.parse({"test", "--reporter", "junit CmdLine.tests.cpp:: passed: config.reporterName == "junit" for: "junit" == "junit" CmdLine.tests.cpp:: passed: !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) for: !{?} CmdLine.tests.cpp:: passed: !result for: true -CmdLine.tests.cpp:: passed: result.errorMessage(), Contains("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" +CmdLine.tests.cpp:: passed: result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" CmdLine.tests.cpp:: passed: cli.parse({"test", "-b"}) for: {?} CmdLine.tests.cpp:: passed: config.shouldDebugBreak == true for: true == true CmdLine.tests.cpp:: passed: cli.parse({"test", "--break"}) for: {?} @@ -1226,7 +1226,7 @@ CmdLine.tests.cpp:: passed: config.abortAfter == 1 for: 1 == 1 CmdLine.tests.cpp:: passed: cli.parse({"test", "-x", "2"}) for: {?} CmdLine.tests.cpp:: passed: config.abortAfter == 2 for: 2 == 2 CmdLine.tests.cpp:: passed: !result for: true -CmdLine.tests.cpp:: passed: result.errorMessage(), Contains("convert") && Contains("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) +CmdLine.tests.cpp:: passed: result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) CmdLine.tests.cpp:: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} CmdLine.tests.cpp:: passed: config.waitForKeypress == std::get<1>(input) for: 0 == 0 CmdLine.tests.cpp:: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} @@ -1236,7 +1236,7 @@ CmdLine.tests.cpp:: passed: config.waitForKeypress == std::get<1>(i CmdLine.tests.cpp:: passed: cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} CmdLine.tests.cpp:: passed: config.waitForKeypress == std::get<1>(input) for: 3 == 3 CmdLine.tests.cpp:: passed: !result for: true -CmdLine.tests.cpp:: passed: result.errorMessage(), Contains("never") && Contains("both") for: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) +CmdLine.tests.cpp:: passed: result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") for: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) CmdLine.tests.cpp:: passed: cli.parse({"test", "-e"}) for: {?} CmdLine.tests.cpp:: passed: config.noThrow for: true CmdLine.tests.cpp:: passed: cli.parse({"test", "--nothrow"}) for: {?} @@ -1258,7 +1258,7 @@ CmdLine.tests.cpp:: passed: config.useColour == UseColour::Yes for: CmdLine.tests.cpp:: passed: cli.parse({"test", "--use-colour", "no"}) for: {?} CmdLine.tests.cpp:: passed: config.useColour == UseColour::No for: 2 == 2 CmdLine.tests.cpp:: passed: !result for: true -CmdLine.tests.cpp:: passed: result.errorMessage(), Contains( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" +CmdLine.tests.cpp:: passed: result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" CmdLine.tests.cpp:: passed: cli.parse({ "test", "--benchmark-samples=200" }) for: {?} CmdLine.tests.cpp:: passed: config.benchmarkSamples == 200 for: 200 == 200 CmdLine.tests.cpp:: passed: cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?} @@ -1279,74 +1279,74 @@ Matchers.tests.cpp:: failed: testStringForMatching(), Matches( "con Matchers.tests.cpp:: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively Matchers.tests.cpp:: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: automake' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: automake' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: " All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: junit' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: " Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: junit' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: " All available test cases: fake test name [fakeTestTag] @@ -1354,20 +1354,20 @@ All available test cases: " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: " All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: " Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: " All available test cases: fake test name [fakeTestTag] @@ -1375,43 +1375,43 @@ All available test cases: " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: tap' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: tap' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: "All available tags: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: teamcity' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: teamcity' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fakeTag"s) for: " 1 @@ -1421,7 +1421,7 @@ Reporters.tests.cpp:: passed: listingString, Contains("fakeTag"s) f " contains: "fakeTag" with 1 message: 'Tested reporter: xml' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: " fake reporter @@ -1429,7 +1429,7 @@ Reporters.tests.cpp:: passed: listingString, Contains("fake reporte " contains: "fake reporter" with 1 message: 'Tested reporter: xml' Reporters.tests.cpp:: passed: !(factories.empty()) for: !false -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: " +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: " fake test name @@ -1476,10 +1476,10 @@ ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify(arr) = ToStringGeneral.tests.cpp:: passed: Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" for: "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" == "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" -Matchers.tests.cpp:: passed: testStringForMatching(), Contains( "string" ) for: "this string contains 'abc' as a substring" contains: "string" -Matchers.tests.cpp:: passed: testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) -Matchers.tests.cpp:: passed: testStringForMatching(), Contains( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" -Matchers.tests.cpp:: passed: testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) +Matchers.tests.cpp:: passed: testStringForMatching(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +Matchers.tests.cpp:: passed: testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +Matchers.tests.cpp:: passed: testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +Matchers.tests.cpp:: passed: testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) Matchers.tests.cpp:: passed: testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this" Matchers.tests.cpp:: passed: testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) Matchers.tests.cpp:: passed: testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring" @@ -1560,16 +1560,16 @@ Misc.tests.cpp:: failed: s1 == s2 for: "if ($b == 10) { $a = 20; } " -Tag.tests.cpp:: passed: what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:: passed: what, ContainsSubstring( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" -Tag.tests.cpp:: passed: what, Contains( "file" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:: passed: what, ContainsSubstring( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" -Tag.tests.cpp:: passed: what, Contains( "2" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:: passed: what, ContainsSubstring( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" -Tag.tests.cpp:: passed: what, Contains( "10" ) for: "error: tag alias, '[@zzz]' already registered. +Tag.tests.cpp:: passed: what, ContainsSubstring( "10" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "10" Tag.tests.cpp:: passed: registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) @@ -1736,16 +1736,16 @@ Misc.tests.cpp:: failed: explicitly Misc.tests.cpp:: failed - but was ok: false Misc.tests.cpp:: failed: explicitly Message.tests.cpp:: failed - but was ok: 1 == 2 -Reporters.tests.cpp:: passed: listingString, Contains("[fakeTag]"s) for: "All available tags: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" -Reporters.tests.cpp:: passed: listingString, Contains("fake reporter"s) for: "Available reporters: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" -Reporters.tests.cpp:: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: +Reporters.tests.cpp:: passed: listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case @@ -1987,7 +1987,7 @@ Xml.tests.cpp:: passed: encode( stringWithQuotes, Catch::XmlEncode: "don't "quote" me on that" Xml.tests.cpp:: passed: encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" Xml.tests.cpp:: passed: encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" -Xml.tests.cpp:: passed: stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") for: " +Xml.tests.cpp:: passed: stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") for: " " ( contains: "attr1="true"" and contains: "attr2="false"" ) InternalBenchmark.tests.cpp:: passed: analysis.mean.point.count() == 23 for: 23.0 == 23 diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index 13b39435..6c7a58f6 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -332,13 +332,13 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: 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:: FAILED: - CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" @@ -678,7 +678,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: 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" ) @@ -690,7 +690,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: FAILED: - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index ba1d14c9..8008e9b9 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -3519,13 +3519,13 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: 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:: FAILED: - CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" @@ -4119,12 +4119,12 @@ with expansion: "expected exception" ends with: "exception" Exception.tests.cpp:: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) ) + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "except" ) ) with expansion: "expected exception" contains: "except" Exception.tests.cpp:: PASSED: - REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) ) + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) ) with expansion: "expected exception" contains: "except" (case insensitive) @@ -6893,7 +6893,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: PASSED: - CHECK_THAT( testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) @@ -6905,13 +6905,13 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: PASSED: - 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" or contains: "random" ) Matchers.tests.cpp:: PASSED: - CHECK_THAT( testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) ) + CHECK_THAT( testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) ) with expansion: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) @@ -6923,7 +6923,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: PASSED: - CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) @@ -6935,7 +6935,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: 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" ) @@ -6947,7 +6947,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: PASSED: - CHECK_THAT( testStringForMatching(), !Contains( "different" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "different" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "different" @@ -6958,7 +6958,7 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: FAILED: - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" @@ -8877,7 +8877,7 @@ with expansion: true CmdLine.tests.cpp:: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("Unrecognized reporter") ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Unrecognized reporter") ) with expansion: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" @@ -8968,7 +8968,7 @@ with expansion: true CmdLine.tests.cpp:: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("convert") && Contains("oops") ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") ) with expansion: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) @@ -9064,7 +9064,7 @@ with expansion: true CmdLine.tests.cpp:: PASSED: - REQUIRE_THAT( result.errorMessage(), Contains("never") && Contains("both") ) + REQUIRE_THAT( result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") ) with expansion: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) @@ -9255,7 +9255,7 @@ with expansion: true CmdLine.tests.cpp:: PASSED: - CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ) + CHECK_THAT( result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) ) with expansion: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" @@ -9459,7 +9459,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9488,7 +9488,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -9516,7 +9516,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9546,7 +9546,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9575,7 +9575,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -9603,7 +9603,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9633,7 +9633,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9662,7 +9662,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -9690,7 +9690,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9720,7 +9720,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: " All available tags: @@ -9750,7 +9750,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: " Available reporters: @@ -9779,7 +9779,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: " All available test cases: @@ -9810,7 +9810,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: " All available tags: @@ -9840,7 +9840,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: " Available reporters: @@ -9869,7 +9869,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: " All available test cases: @@ -9900,7 +9900,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -9929,7 +9929,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -9957,7 +9957,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -9987,7 +9987,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -10016,7 +10016,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -10044,7 +10044,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -10074,7 +10074,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fakeTag"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fakeTag"s) ) with expansion: " @@ -10107,7 +10107,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: " @@ -10138,7 +10138,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: " @@ -10474,23 +10474,23 @@ Matchers.tests.cpp: ............................................................................... Matchers.tests.cpp:: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains( "string" ) ) + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "string" ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" Matchers.tests.cpp:: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) ) + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" (case insensitive) Matchers.tests.cpp:: PASSED: - CHECK_THAT( testStringForMatching(), Contains( "abc" ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" Matchers.tests.cpp:: PASSED: - CHECK_THAT( testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) ) + CHECK_THAT( testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) @@ -11035,28 +11035,28 @@ Tag.tests.cpp: ............................................................................... Tag.tests.cpp:: PASSED: - CHECK_THAT( what, Contains( "[@zzz]" ) ) + CHECK_THAT( what, ContainsSubstring( "[@zzz]" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" Tag.tests.cpp:: PASSED: - CHECK_THAT( what, Contains( "file" ) ) + CHECK_THAT( what, ContainsSubstring( "file" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" Tag.tests.cpp:: PASSED: - CHECK_THAT( what, Contains( "2" ) ) + CHECK_THAT( what, ContainsSubstring( "2" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" Tag.tests.cpp:: PASSED: - CHECK_THAT( what, Contains( "10" ) ) + CHECK_THAT( what, ContainsSubstring( "10" ) ) with expansion: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 @@ -12451,7 +12451,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("[fakeTag]"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("[fakeTag]"s) ) with expansion: "All available tags: 1 [fakeTag] @@ -12467,7 +12467,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains("fake reporter"s) ) + REQUIRE_THAT( listingString, ContainsSubstring("fake reporter"s) ) with expansion: "Available reporters: fake reporter: fake description @@ -12482,7 +12482,7 @@ Reporters.tests.cpp: ............................................................................... Reporters.tests.cpp:: PASSED: - REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) ) + REQUIRE_THAT( listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) ) with expansion: "All available test cases: fake test name @@ -14116,7 +14116,7 @@ Xml.tests.cpp: ............................................................................... Xml.tests.cpp:: PASSED: - REQUIRE_THAT( stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") ) + REQUIRE_THAT( stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") ) with expansion: " diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index f6285201..d4b0b7d7 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -398,17 +398,17 @@ Exception.tests.cpp: - + 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: - + 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: @@ -800,9 +800,9 @@ Condition.tests.cpp: - + 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" ) @@ -811,9 +811,9 @@ Matchers.tests.cpp: - + 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: diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index c95948c3..d8f09bf9 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -1008,16 +1008,16 @@ Exception.tests.cpp: - + 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: - + 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: @@ -1116,9 +1116,9 @@ Matchers.tests.cpp: - + 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: @@ -1126,9 +1126,9 @@ Matchers.tests.cpp: - + 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: diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index a82febac..43af4ca9 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -893,9 +893,9 @@ ok {test-number} - first.matchCalled for: true # Composed matchers shortcircuit ok {test-number} - !second.matchCalled for: true # Contains string matcher -not ok {test-number} - testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) +not ok {test-number} - testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) # Contains string matcher -not ok {test-number} - testStringForMatching(), Contains( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" +not ok {test-number} - testStringForMatching(), ContainsSubstring( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" # Copy and then generate a range ok {test-number} - elem % 2 == 1 for: 1 == 1 # Copy and then generate a range @@ -1039,9 +1039,9 @@ ok {test-number} - thisThrows(), StartsWith( "expected" ) for: "expected excepti # Exception messages can be tested for ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception" # Exception messages can be tested for -ok {test-number} - thisThrows(), Contains( "except" ) for: "expected exception" contains: "except" +ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except" # Exception messages can be tested for -ok {test-number} - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) +ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) # Exceptions matchers ok {test-number} - throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what" # Exceptions matchers @@ -1791,19 +1791,19 @@ ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) # ManuallyRegistered ok {test-number} - with 1 message: 'was called' # Matchers can be (AllOf) composed with the && operator -ok {test-number} - testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) # Matchers can be (AnyOf) composed with the || operator -ok {test-number} - testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) # Matchers can be (AnyOf) composed with the || operator -ok {test-number} - testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) +ok {test-number} - testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) # Matchers can be composed with both && and || -ok {test-number} - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +ok {test-number} - testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) # Matchers can be composed with both && and || - failing -not ok {test-number} - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +not ok {test-number} - testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) # Matchers can be negated (Not) with the ! operator -ok {test-number} - testStringForMatching(), !Contains( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +ok {test-number} - testStringForMatching(), !ContainsSubstring( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" # Matchers can be negated (Not) with the ! operator - failing -not ok {test-number} - testStringForMatching(), !Contains( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" +not ok {test-number} - testStringForMatching(), !ContainsSubstring( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" # Mismatching exception messages failing the test ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" # Mismatching exception messages failing the test @@ -2355,7 +2355,7 @@ ok {test-number} - !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) for: !{? # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - result.errorMessage(), Contains("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" +ok {test-number} - result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" # Process can be configured on command line ok {test-number} - cli.parse({"test", "-b"}) for: {?} # Process can be configured on command line @@ -2375,7 +2375,7 @@ ok {test-number} - config.abortAfter == 2 for: 2 == 2 # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - result.errorMessage(), Contains("convert") && Contains("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) +ok {test-number} - result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") for: "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) # Process can be configured on command line ok {test-number} - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) for: {?} # Process can be configured on command line @@ -2395,7 +2395,7 @@ ok {test-number} - config.waitForKeypress == std::get<1>(input) for: 3 == 3 # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - result.errorMessage(), Contains("never") && Contains("both") for: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) +ok {test-number} - result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") for: "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) # Process can be configured on command line ok {test-number} - cli.parse({"test", "-e"}) for: {?} # Process can be configured on command line @@ -2439,7 +2439,7 @@ ok {test-number} - config.useColour == UseColour::No for: 2 == 2 # Process can be configured on command line ok {test-number} - !result for: true # Process can be configured on command line -ok {test-number} - result.errorMessage(), Contains( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" +ok {test-number} - result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" # Process can be configured on command line ok {test-number} - cli.parse({ "test", "--benchmark-samples=200" }) for: {?} # Process can be configured on command line @@ -2481,99 +2481,99 @@ ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not Un # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: automake' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: automake' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: automake' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: automake' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: " All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: junit' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: " All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: junit' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: " Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: junit' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: " Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: junit' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: " All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: " All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: " All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: " All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: " Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: " Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: " All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: " All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: tap' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: tap' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: tap' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: tap' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: teamcity' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: teamcity' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: teamcity' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: teamcity' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fakeTag"s) for: " 1 fakeTag " contains: "fakeTag" with 1 message: 'Tested reporter: xml' +ok {test-number} - listingString, ContainsSubstring("fakeTag"s) for: " 1 fakeTag " contains: "fakeTag" with 1 message: 'Tested reporter: xml' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: " fake reporter fake description " contains: "fake reporter" with 1 message: 'Tested reporter: xml' +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: " fake reporter fake description " contains: "fake reporter" with 1 message: 'Tested reporter: xml' # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: " fake test name [fakeTestTag] fake-file.cpp 123456789 " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: xml' +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: " fake test name [fakeTestTag] fake-file.cpp 123456789 " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: xml' # SUCCEED counts as a test pass ok {test-number} - with 1 message: 'this is a success' # SUCCEED does not require an argument @@ -2636,13 +2636,13 @@ ok {test-number} - Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" for: "{ 3, 2, # Static arrays are convertible to string ok {test-number} - Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" for: "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" == "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" # String matchers -ok {test-number} - testStringForMatching(), Contains( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string" # String matchers -ok {test-number} - testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +ok {test-number} - testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) # String matchers -ok {test-number} - testStringForMatching(), Contains( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +ok {test-number} - testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" # String matchers -ok {test-number} - testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) +ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) # String matchers ok {test-number} - testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this" # String matchers @@ -2782,13 +2782,13 @@ ok {test-number} - now != later for: {iso8601-timestamp} != {iso8601-timestamp} # Tabs and newlines show in output not ok {test-number} - s1 == s2 for: "if ($b == 10) { $a = 20; }" == "if ($b == 10) { $a = 20; } " # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" +ok {test-number} - what, ContainsSubstring( "[@zzz]" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "[@zzz]" # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" +ok {test-number} - what, ContainsSubstring( "file" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "file" # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" +ok {test-number} - what, ContainsSubstring( "2" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "2" # Tag alias can be registered against tag patterns -ok {test-number} - what, Contains( "10" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "10" +ok {test-number} - what, ContainsSubstring( "10" ) for: "error: tag alias, '[@zzz]' already registered. First seen at: file:2 Redefined at: file:10" contains: "10" # Tag alias can be registered against tag patterns ok {test-number} - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) # Tag alias can be registered against tag patterns @@ -3118,11 +3118,11 @@ not ok {test-number} - explicitly # The NO_FAIL macro reports a failure but does not fail the test ok {test-number} - 1 == 2 # TODO # The default listing implementation write to provided stream -ok {test-number} - listingString, Contains("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" +ok {test-number} - listingString, ContainsSubstring("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]" # The default listing implementation write to provided stream -ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" +ok {test-number} - listingString, ContainsSubstring("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" # The default listing implementation write to provided stream -ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) +ok {test-number} - listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) # This test 'should' fail but doesn't ok {test-number} - with 1 message: 'oops!' # Thrown string literals are translated @@ -3552,7 +3552,7 @@ ok {test-number} - encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" # XmlEncode ok {test-number} - encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" # XmlWriter writes boolean attributes as true/false -ok {test-number} - stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") for: " " ( contains: "attr1="true"" and contains: "attr2="false"" ) +ok {test-number} - stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") for: " " ( contains: "attr1="true"" and contains: "attr2="false"" ) # analyse no analysis ok {test-number} - analysis.mean.point.count() == 23 for: 23.0 == 23 # analyse no analysis diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index 3867ec4a..c30de7fd 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -270,8 +270,8 @@ Exception.tests.cpp:|nunexpected exception with message:|n "unexpe ##teamcity[testStarted name='Composed matchers shortcircuit'] ##teamcity[testFinished name='Composed matchers shortcircuit' duration="{duration}"] ##teamcity[testStarted name='Contains string matcher'] -Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] -Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] +Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] +Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] ##teamcity[testFinished name='Contains string matcher' duration="{duration}"] ##teamcity[testStarted name='Copy and then generate a range'] ##teamcity[testFinished name='Copy and then generate a range' duration="{duration}"] @@ -399,12 +399,12 @@ Condition.tests.cpp:|nexpression failed|n CHECK( data.str_hello.si ##teamcity[testStarted name='Matchers can be composed with both && and ||||'] ##teamcity[testFinished name='Matchers can be composed with both && and ||||' duration="{duration}"] ##teamcity[testStarted name='Matchers can be composed with both && and |||| - failing'] -Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), ( Contains( "string" ) |||| Contains( "different" ) ) && Contains( "random" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] +Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) |||| ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] ##teamcity[testFinished name='Matchers can be composed with both && and |||| - failing' duration="{duration}"] ##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator'] ##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator' duration="{duration}"] ##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator - failing'] -Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), !Contains( "substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] +Matchers.tests.cpp:|nexpression failed|n CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] ##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator - failing' duration="{duration}"] ##teamcity[testStarted name='Mismatching exception messages failing the test'] Exception.tests.cpp:|nexpression failed|n REQUIRE_THROWS_WITH( thisThrows(), "should fail" )|nwith expansion:|n "expected exception" equals: "should fail"|n'] diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 917010be..cba47717 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -3884,7 +3884,7 @@ Nor would this - testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) + testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) "this string contains 'abc' as a substring" contains: "not there" (case insensitive) @@ -3892,7 +3892,7 @@ Nor would this - testStringForMatching(), Contains( "STRING" ) + testStringForMatching(), ContainsSubstring( "STRING" ) "this string contains 'abc' as a substring" contains: "STRING" @@ -4592,7 +4592,7 @@ Nor would this - thisThrows(), Contains( "except" ) + thisThrows(), ContainsSubstring( "except" ) "expected exception" contains: "except" @@ -4600,7 +4600,7 @@ Nor would this - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) + thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) "expected exception" contains: "except" (case insensitive) @@ -8356,7 +8356,7 @@ Nor would this - testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) + testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) @@ -8367,7 +8367,7 @@ Nor would this - testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) + testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) @@ -8375,7 +8375,7 @@ Nor would this - testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) + testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) @@ -8386,7 +8386,7 @@ Nor would this - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) + testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "substring" ) "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) @@ -8397,7 +8397,7 @@ Nor would this - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) + testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "random" ) "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -8408,7 +8408,7 @@ Nor would this - testStringForMatching(), !Contains( "different" ) + testStringForMatching(), !ContainsSubstring( "different" ) "this string contains 'abc' as a substring" not contains: "different" @@ -8419,7 +8419,7 @@ Nor would this - testStringForMatching(), !Contains( "substring" ) + testStringForMatching(), !ContainsSubstring( "substring" ) "this string contains 'abc' as a substring" not contains: "substring" @@ -10842,7 +10842,7 @@ Nor would this - result.errorMessage(), Contains("Unrecognized reporter") + result.errorMessage(), ContainsSubstring("Unrecognized reporter") "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" @@ -10952,7 +10952,7 @@ Nor would this - result.errorMessage(), Contains("convert") && Contains("oops") + result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops") "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) @@ -11075,7 +11075,7 @@ Nor would this - result.errorMessage(), Contains("never") && Contains("both") + result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both") "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) @@ -11313,7 +11313,7 @@ Nor would this - result.errorMessage(), Contains( "colour mode must be one of" ) + result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" @@ -11543,7 +11543,7 @@ Nor would this - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "All available tags: @@ -11569,7 +11569,7 @@ Nor would this - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "Available reporters: @@ -11594,7 +11594,7 @@ Nor would this - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "All available test cases: @@ -11621,7 +11621,7 @@ Nor would this - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "All available tags: @@ -11647,7 +11647,7 @@ Nor would this - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "Available reporters: @@ -11672,7 +11672,7 @@ Nor would this - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "All available test cases: @@ -11699,7 +11699,7 @@ Nor would this - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "All available tags: @@ -11725,7 +11725,7 @@ Nor would this - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "Available reporters: @@ -11750,7 +11750,7 @@ Nor would this - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "All available test cases: @@ -11777,7 +11777,7 @@ Nor would this - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "<?xml version="1.0" encoding="UTF-8"?> @@ -11804,7 +11804,7 @@ All available tags: - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "<?xml version="1.0" encoding="UTF-8"?> @@ -11830,7 +11830,7 @@ Available reporters: - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "<?xml version="1.0" encoding="UTF-8"?> @@ -11858,7 +11858,7 @@ All available test cases: - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "<?xml version="1.0" encoding="UTF-8"?> @@ -11885,7 +11885,7 @@ All available tags: - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "<?xml version="1.0" encoding="UTF-8"?> @@ -11911,7 +11911,7 @@ Available reporters: - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "<?xml version="1.0" encoding="UTF-8"?> @@ -11939,7 +11939,7 @@ All available test cases: - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "All available tags: @@ -11965,7 +11965,7 @@ All available test cases: - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "Available reporters: @@ -11990,7 +11990,7 @@ All available test cases: - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "All available test cases: @@ -12017,7 +12017,7 @@ All available test cases: - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "All available tags: @@ -12043,7 +12043,7 @@ All available test cases: - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "Available reporters: @@ -12068,7 +12068,7 @@ All available test cases: - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "All available test cases: @@ -12095,7 +12095,7 @@ All available test cases: - listingString, Contains("fakeTag"s) + listingString, ContainsSubstring("fakeTag"s) "<?xml version="1.0" encoding="UTF-8"?> @@ -12125,7 +12125,7 @@ All available test cases: - listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "<?xml version="1.0" encoding="UTF-8"?> @@ -12153,7 +12153,7 @@ All available test cases: - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "<?xml version="1.0" encoding="UTF-8"?> @@ -12497,7 +12497,7 @@ Message from section two - testStringForMatching(), Contains( "string" ) + testStringForMatching(), ContainsSubstring( "string" ) "this string contains 'abc' as a substring" contains: "string" @@ -12505,7 +12505,7 @@ Message from section two - testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) + testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) "this string contains 'abc' as a substring" contains: "string" (case insensitive) @@ -12513,7 +12513,7 @@ Message from section two - testStringForMatching(), Contains( "abc" ) + testStringForMatching(), ContainsSubstring( "abc" ) "this string contains 'abc' as a substring" contains: "abc" @@ -12521,7 +12521,7 @@ Message from section two - testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) + testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) "this string contains 'abc' as a substring" contains: "abc" (case insensitive) @@ -13091,7 +13091,7 @@ Message from section two
- what, Contains( "[@zzz]" ) + what, ContainsSubstring( "[@zzz]" ) "error: tag alias, '[@zzz]' already registered. @@ -13101,7 +13101,7 @@ Message from section two - what, Contains( "file" ) + what, ContainsSubstring( "file" ) "error: tag alias, '[@zzz]' already registered. @@ -13111,7 +13111,7 @@ Message from section two - what, Contains( "2" ) + what, ContainsSubstring( "2" ) "error: tag alias, '[@zzz]' already registered. @@ -13121,7 +13121,7 @@ Message from section two - what, Contains( "10" ) + what, ContainsSubstring( "10" ) "error: tag alias, '[@zzz]' already registered. @@ -14601,7 +14601,7 @@ Message from section two
- listingString, Contains("[fakeTag]"s) + listingString, ContainsSubstring("[fakeTag]"s) "All available tags: @@ -14616,7 +14616,7 @@ Message from section two
- listingString, Contains("fake reporter"s) + listingString, ContainsSubstring("fake reporter"s) "Available reporters: @@ -14630,7 +14630,7 @@ Message from section two
- listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + listingString, ContainsSubstring( "fake test name"s ) && ContainsSubstring( "fakeTestTag"s ) "All available test cases: @@ -16592,7 +16592,7 @@ There is no extra whitespace here - stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") + stream.str(), ContainsSubstring(R"(attr1="true")") && ContainsSubstring(R"(attr2="false")") "<?xml version="1.0" encoding="UTF-8"?> diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp index e8bf6e5f..c1fd6527 100644 --- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp @@ -406,7 +406,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" auto result = cli.parse({"test", "--reporter", "unsupported"}); CHECK(!result); - REQUIRE_THAT(result.errorMessage(), Contains("Unrecognized reporter")); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("Unrecognized reporter")); } } @@ -438,7 +438,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" SECTION("-x must be numeric") { auto result = cli.parse({"test", "-x", "oops"}); CHECK(!result); - REQUIRE_THAT(result.errorMessage(), Contains("convert") && Contains("oops")); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("convert") && ContainsSubstring("oops")); } SECTION("wait-for-keypress") { @@ -460,7 +460,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" CHECK(!result); #ifndef CATCH_CONFIG_DISABLE_MATCHERS - REQUIRE_THAT(result.errorMessage(), Contains("never") && Contains("both")); + REQUIRE_THAT(result.errorMessage(), ContainsSubstring("never") && ContainsSubstring("both")); #endif } } @@ -534,7 +534,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]" SECTION( "error" ) { auto result = cli.parse({"test", "--use-colour", "wrong"}); CHECK( !result ); - CHECK_THAT( result.errorMessage(), Contains( "colour mode must be one of" ) ); + CHECK_THAT( result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) ); } } diff --git a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp index c5c97998..69d05eef 100644 --- a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp @@ -21,7 +21,7 @@ TEST_CASE( "The default listing implementation write to provided stream", "[reporters][reporter-helpers]" ) { - using Catch::Matchers::Contains; + using Catch::Matchers::ContainsSubstring; using namespace std::string_literals; std::stringstream sstream; @@ -31,7 +31,7 @@ TEST_CASE( "The default listing implementation write to provided stream", Catch::defaultListTags(sstream, tags, false); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("[fakeTag]"s)); + REQUIRE_THAT(listingString, ContainsSubstring("[fakeTag]"s)); } SECTION( "Listing reporters" ) { std::vector reporters( @@ -39,7 +39,7 @@ TEST_CASE( "The default listing implementation write to provided stream", Catch::defaultListReporters(sstream, reporters, Catch::Verbosity::Normal); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("fake reporter"s)); + REQUIRE_THAT(listingString, ContainsSubstring("fake reporter"s)); } SECTION( "Listing tests" ) { Catch::TestCaseInfo fakeInfo{ @@ -51,13 +51,13 @@ TEST_CASE( "The default listing implementation write to provided stream", auto listingString = sstream.str(); REQUIRE_THAT( listingString, - Contains( "fake test name"s ) && - Contains( "fakeTestTag"s ) ); + ContainsSubstring( "fake test name"s ) && + ContainsSubstring( "fakeTestTag"s ) ); } } TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { - using Catch::Matchers::Contains; + using Catch::Matchers::ContainsSubstring; using namespace std::string_literals; auto const& factories = Catch::getRegistryHub().getReporterRegistry().getFactories(); @@ -80,7 +80,7 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { reporter->listTags(tags); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("fakeTag"s)); + REQUIRE_THAT(listingString, ContainsSubstring("fakeTag"s)); } DYNAMIC_SECTION( factory.first << " reporter lists reporters" ) { @@ -89,7 +89,7 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { reporter->listReporters(reporters); auto listingString = sstream.str(); - REQUIRE_THAT(listingString, Contains("fake reporter"s)); + REQUIRE_THAT(listingString, ContainsSubstring("fake reporter"s)); } DYNAMIC_SECTION( factory.first << " reporter lists tests" ) { @@ -102,8 +102,8 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { auto listingString = sstream.str(); REQUIRE_THAT( listingString, - Contains( "fake test name"s ) && - Contains( "fakeTestTag"s ) ); + ContainsSubstring( "fake test name"s ) && + ContainsSubstring( "fakeTestTag"s ) ); } } } diff --git a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp index a74b3159..2feffa44 100644 --- a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp @@ -24,10 +24,10 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) { catch( std::exception& ex ) { std::string what = ex.what(); using namespace Catch::Matchers; - CHECK_THAT( what, Contains( "[@zzz]" ) ); - CHECK_THAT( what, Contains( "file" ) ); - CHECK_THAT( what, Contains( "2" ) ); - CHECK_THAT( what, Contains( "10" ) ); + CHECK_THAT( what, ContainsSubstring( "[@zzz]" ) ); + CHECK_THAT( what, ContainsSubstring( "file" ) ); + CHECK_THAT( what, ContainsSubstring( "2" ) ); + CHECK_THAT( what, ContainsSubstring( "10" ) ); } } diff --git a/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp b/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp index c98d66ef..0459c579 100644 --- a/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp @@ -117,7 +117,7 @@ TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") { } TEST_CASE("XmlWriter writes boolean attributes as true/false", "[XML][XmlWriter]") { - using Catch::Matchers::Contains; + using Catch::Matchers::ContainsSubstring; std::stringstream stream; { Catch::XmlWriter xml(stream); @@ -128,6 +128,6 @@ TEST_CASE("XmlWriter writes boolean attributes as true/false", "[XML][XmlWriter] } REQUIRE_THAT( stream.str(), - Contains(R"(attr1="true")") && - Contains(R"(attr2="false")") ); + ContainsSubstring(R"(attr1="true")") && + ContainsSubstring(R"(attr2="false")") ); } diff --git a/tests/SelfTest/UsageTests/Exception.tests.cpp b/tests/SelfTest/UsageTests/Exception.tests.cpp index 206bd9c8..9b4ea030 100644 --- a/tests/SelfTest/UsageTests/Exception.tests.cpp +++ b/tests/SelfTest/UsageTests/Exception.tests.cpp @@ -167,8 +167,8 @@ TEST_CASE( "Exception messages can be tested for", "[!throws]" ) { SECTION( "wildcarded" ) { REQUIRE_THROWS_WITH( thisThrows(), StartsWith( "expected" ) ); REQUIRE_THROWS_WITH( thisThrows(), EndsWith( "exception" ) ); - REQUIRE_THROWS_WITH( thisThrows(), Contains( "except" ) ); - REQUIRE_THROWS_WITH( thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) ); + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "except" ) ); + REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) ); } } diff --git a/tests/SelfTest/UsageTests/Matchers.tests.cpp b/tests/SelfTest/UsageTests/Matchers.tests.cpp index 6f83279f..75578d68 100644 --- a/tests/SelfTest/UsageTests/Matchers.tests.cpp +++ b/tests/SelfTest/UsageTests/Matchers.tests.cpp @@ -105,12 +105,12 @@ namespace { } // end unnamed namespace TEST_CASE( "String matchers", "[matchers]" ) { - REQUIRE_THAT( testStringForMatching(), Contains( "string" ) ); + REQUIRE_THAT( testStringForMatching(), ContainsSubstring( "string" ) ); REQUIRE_THAT( testStringForMatching(), - Contains( "string", Catch::CaseSensitive::No ) ); - CHECK_THAT( testStringForMatching(), Contains( "abc" ) ); + ContainsSubstring( "string", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), ContainsSubstring( "abc" ) ); CHECK_THAT( testStringForMatching(), - Contains( "aBC", Catch::CaseSensitive::No ) ); + ContainsSubstring( "aBC", Catch::CaseSensitive::No ) ); CHECK_THAT( testStringForMatching(), StartsWith( "this" ) ); CHECK_THAT( testStringForMatching(), @@ -122,8 +122,8 @@ TEST_CASE( "String matchers", "[matchers]" ) { TEST_CASE( "Contains string matcher", "[.][failing][matchers]" ) { CHECK_THAT( testStringForMatching(), - Contains( "not there", Catch::CaseSensitive::No ) ); - CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ); + ContainsSubstring( "not there", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) ); } TEST_CASE( "StartsWith string matcher", "[.][failing][matchers]" ) { @@ -185,42 +185,42 @@ TEST_CASE( "Regex string matcher", "[matchers][.failing]" ) { TEST_CASE( "Matchers can be (AllOf) composed with the && operator", "[matchers][operators][operator&&]" ) { CHECK_THAT( testStringForMatching(), - Contains( "string" ) && Contains( "abc" ) && - Contains( "substring" ) && Contains( "contains" ) ); + ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && + ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) ); } TEST_CASE( "Matchers can be (AnyOf) composed with the || operator", "[matchers][operators][operator||]" ) { CHECK_THAT( testStringForMatching(), - Contains( "string" ) || Contains( "different" ) || - Contains( "random" ) ); + ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || + ContainsSubstring( "random" ) ); CHECK_THAT( testStringForMatching2(), - Contains( "string" ) || Contains( "different" ) || - Contains( "random" ) ); + ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || + ContainsSubstring( "random" ) ); } TEST_CASE( "Matchers can be composed with both && and ||", "[matchers][operators][operator||][operator&&]" ) { CHECK_THAT( testStringForMatching(), - ( Contains( "string" ) || Contains( "different" ) ) && - Contains( "substring" ) ); + ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && + ContainsSubstring( "substring" ) ); } TEST_CASE( "Matchers can be composed with both && and || - failing", "[matchers][operators][operator||][operator&&][.failing]" ) { CHECK_THAT( testStringForMatching(), - ( Contains( "string" ) || Contains( "different" ) ) && - Contains( "random" ) ); + ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && + ContainsSubstring( "random" ) ); } TEST_CASE( "Matchers can be negated (Not) with the ! operator", "[matchers][operators][not]" ) { - CHECK_THAT( testStringForMatching(), !Contains( "different" ) ); + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "different" ) ); } TEST_CASE( "Matchers can be negated (Not) with the ! operator - failing", "[matchers][operators][not][.failing]" ) { - CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ); + CHECK_THAT( testStringForMatching(), !ContainsSubstring( "substring" ) ); } template struct CustomAllocator : private std::allocator {