Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
72611884
Commit
72611884
authored
Jan 27, 2021
by
Abseil Team
Committed by
Dino Radaković
Feb 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Document the fact that MatchAndExplain(T, MatchResultListener*) is supported. PiperOrigin-RevId: 354172275
parent
d1143988
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
gmock_cook_book.md
docs/gmock_cook_book.md
+3
-0
gtest-matchers.h
googletest/include/gtest/gtest-matchers.h
+1
-0
No files found.
docs/gmock_cook_book.md
View file @
72611884
...
...
@@ -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
...
...
googletest/include/gtest/gtest-matchers.h
View file @
72611884
...
...
@@ -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*);
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment