Commit 72611884 authored by Abseil Team's avatar Abseil Team Committed by Dino Radaković
Browse files

Googletest export

Document the fact that MatchAndExplain(T, MatchResultListener*) is supported.

PiperOrigin-RevId: 354172275
parent d1143988
...@@ -3618,6 +3618,9 @@ Expected: is divisible by 7 ...@@ -3618,6 +3618,9 @@ Expected: is divisible by 7
Actual: 23 (the remainder is 2) Actual: 23 (the remainder is 2)
``` ```
Tip: for convenience, `MatchAndExplain()` can take a `MatchResultListener*`
instead of `std::ostream*`.
### Writing New Polymorphic Matchers ### Writing New Polymorphic Matchers
Expanding what we learned above to *polymorphic* matchers is now just as simple Expanding what we learned above to *polymorphic* matchers is now just as simple
......
...@@ -67,6 +67,7 @@ namespace testing { ...@@ -67,6 +67,7 @@ namespace testing {
// 1. a class FooMatcherMatcher that implements the matcher interface: // 1. a class FooMatcherMatcher that implements the matcher interface:
// using is_gtest_matcher = void; // using is_gtest_matcher = void;
// bool MatchAndExplain(const T&, std::ostream*); // bool MatchAndExplain(const T&, std::ostream*);
// (MatchResultListener* can also be used instead of std::ostream*)
// void DescribeTo(std::ostream*); // void DescribeTo(std::ostream*);
// void DescribeNegationTo(std::ostream*); // void DescribeNegationTo(std::ostream*);
// //
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment