diff --git a/include/internal/catch_matchers.h b/include/internal/catch_matchers.h index 29692fc0..aebd4c23 100644 --- a/include/internal/catch_matchers.h +++ b/include/internal/catch_matchers.h @@ -43,10 +43,6 @@ namespace Matchers { struct MatcherMethod { virtual bool match( ObjectT const& arg ) const = 0; }; - template - struct MatcherMethod { - virtual bool match( PtrT* arg ) const = 0; - }; #ifdef __clang__ # pragma clang diagnostic pop diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 2b1b917a..41b63712 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -679,6 +679,7 @@ Condition.tests.cpp:: passed: cpc != 0 for: 0x != 0 Condition.tests.cpp:: passed: returnsNull() == 0 for: {null string} == 0 Condition.tests.cpp:: passed: returnsConstNull() == 0 for: {null string} == 0 Condition.tests.cpp:: passed: 0 != p for: 0 != 0x +Matchers.tests.cpp:: passed: "foo", Predicate([] (const char* const&) { return true; }) for: "foo" matches undescribed predicate CmdLine.tests.cpp:: passed: result for: {?} CmdLine.tests.cpp:: passed: config.processName == "" for: "" == "" CmdLine.tests.cpp:: passed: result for: {?} diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 7d3a4db4..9bcfda97 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1098,6 +1098,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 215 | 162 passed | 49 failed | 4 failed as expected -assertions: 1233 | 1104 passed | 108 failed | 21 failed as expected +test cases: 216 | 163 passed | 49 failed | 4 failed as expected +assertions: 1234 | 1105 passed | 108 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index da0950de..b58f8356 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -5739,6 +5739,18 @@ PASSED: with expansion: 0 != 0x +------------------------------------------------------------------------------- +Predicate matcher can accept const char* +------------------------------------------------------------------------------- +Matchers.tests.cpp: +............................................................................... + +Matchers.tests.cpp:: +PASSED: + REQUIRE_THAT( "foo", Predicate([] (const char* const&) { return true; }) ) +with expansion: + "foo" matches undescribed predicate + ------------------------------------------------------------------------------- Process can be configured on command line empty args don't cause a crash @@ -10885,6 +10897,6 @@ Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 215 | 149 passed | 62 failed | 4 failed as expected -assertions: 1247 | 1104 passed | 122 failed | 21 failed as expected +test cases: 216 | 150 passed | 62 failed | 4 failed as expected +assertions: 1248 | 1105 passed | 122 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 0b726c8d..b62c62aa 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -480,6 +480,7 @@ Message.tests.cpp: + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index f573f585..00ea5f76 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -5964,6 +5964,17 @@ + + + + "foo", Predicate<const char*>([] (const char* const&) { return true; }) + + + "foo" matches undescribed predicate + + + +
@@ -11358,7 +11369,7 @@ loose text artifact
- + - + diff --git a/projects/SelfTest/UsageTests/Matchers.tests.cpp b/projects/SelfTest/UsageTests/Matchers.tests.cpp index e09dad14..f07481d4 100644 --- a/projects/SelfTest/UsageTests/Matchers.tests.cpp +++ b/projects/SelfTest/UsageTests/Matchers.tests.cpp @@ -432,6 +432,10 @@ namespace { namespace MatchersTests { CHECK_THAT(actual, !UnorderedEquals(expected)); } + TEST_CASE("Predicate matcher can accept const char*", "[matchers][compilation]") { + REQUIRE_THAT("foo", Predicate([] (const char* const&) { return true; })); + } + } } // namespace MatchersTests #endif // CATCH_CONFIG_DISABLE_MATCHERS