mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Feature: generic matchers (#1843)
This commit extends the Matchers feature with the ability to have type-independent (e.g. templated) matchers. This is done by adding a new base type that Matchers can extend, `MatcherGenericBase`, and overloads of operators `!`, `&&` and `||` that handle matchers extending `MatcherGenericBase` in a special manner. These new matchers can also take their arguments as values and non-const references. Closes #1307 Closes #1553 Closes #1554 Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
This commit is contained in:
@@ -915,6 +915,13 @@ Exception.tests.cpp:<line number>
|
||||
<file path="tests/<exe-name>/UsageTests/Matchers.tests.cpp">
|
||||
<testCase name="Arbitrary predicate matcher/Function pointer" duration="{duration}"/>
|
||||
<testCase name="Arbitrary predicate matcher/Lambdas + different type" duration="{duration}"/>
|
||||
<testCase name="Combining MatchAllOfGeneric does not nest" duration="{duration}"/>
|
||||
<testCase name="Combining MatchAnyOfGeneric does not nest" duration="{duration}"/>
|
||||
<testCase name="Combining MatchNotOfGeneric does not nest" duration="{duration}"/>
|
||||
<testCase name="Combining concrete matchers does not use templated matchers" duration="{duration}"/>
|
||||
<testCase name="Combining only templated matchers" duration="{duration}"/>
|
||||
<testCase name="Combining templated and concrete matchers" duration="{duration}"/>
|
||||
<testCase name="Combining templated matchers" duration="{duration}"/>
|
||||
<testCase name="Contains string matcher" duration="{duration}">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), Contains("not there", Catch::CaseSensitive::No))">
|
||||
FAILED:
|
||||
@@ -1042,6 +1049,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testCase>
|
||||
<testCase name="Overloaded comma or address-of operators are not used" duration="{duration}"/>
|
||||
<testCase name="Predicate matcher can accept const char*" duration="{duration}"/>
|
||||
<testCase name="Regex string matcher" duration="{duration}">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), Matches("this STRING contains 'abc' as a substring"))">
|
||||
|
Reference in New Issue
Block a user