mirror of
https://github.com/google/googletest.git
synced 2024-12-26 17:41:03 +08:00
Mention DescribeMatcher
in matchers.md
PiperOrigin-RevId: 504591836 Change-Id: I48c93490d0c3b7c6bfaceceb1cef5eedeacfe6c6
This commit is contained in:
parent
d1ad27e0a4
commit
643862d8ad
@ -288,3 +288,15 @@ which must be a permanent callback.
|
||||
return ExplainMatchResult(matcher, arg.nested().property(), result_listener);
|
||||
}
|
||||
```
|
||||
|
||||
5. You can use `DescribeMatcher<>` to describe another matcher. For example:
|
||||
|
||||
```cpp
|
||||
MATCHER_P(XAndYThat, matcher,
|
||||
"X that " + DescribeMatcher<int>(matcher, negation) +
|
||||
(negation ? " or" : " and") + " Y that " +
|
||||
DescribeMatcher<double>(matcher, negation)) {
|
||||
return ExplainMatchResult(matcher, arg.x(), result_listener) &&
|
||||
ExplainMatchResult(matcher, arg.y(), result_listener);
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user