Skip to content

Commit

Permalink
Googletest export
Browse files Browse the repository at this point in the history
Document the fact that MatchAndExplain(T, MatchResultListener*) is supported.

PiperOrigin-RevId: 354172275
  • Loading branch information
Abseil Team authored and dinord committed Feb 5, 2021
1 parent d114398 commit 7261188
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/gmock_cook_book.md
Original file line number Diff line number Diff line change
Expand Up @@ -3618,6 +3618,9 @@ Expected: is divisible by 7
Actual: 23 (the remainder is 2)
```

Tip: for convenience, `MatchAndExplain()` can take a `MatchResultListener*`
instead of `std::ostream*`.

### Writing New Polymorphic Matchers

Expanding what we learned above to *polymorphic* matchers is now just as simple
Expand Down
1 change: 1 addition & 0 deletions googletest/include/gtest/gtest-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ namespace testing {
// 1. a class FooMatcherMatcher that implements the matcher interface:
// using is_gtest_matcher = void;
// bool MatchAndExplain(const T&, std::ostream*);
// (MatchResultListener* can also be used instead of std::ostream*)
// void DescribeTo(std::ostream*);
// void DescribeNegationTo(std::ostream*);
//
Expand Down

0 comments on commit 7261188

Please sign in to comment.