Googletest export

Explain how to wrap matchers.

PiperOrigin-RevId: 357901293
This commit is contained in:
Abseil Team 2021-02-17 04:48:06 -05:00 committed by Derek Mauro
parent 5893778716
commit 7fb047bca3

View File

@ -477,6 +477,14 @@ which must be a permanent callback.
being matched and the matcher parameters). being matched and the matcher parameters).
3. You can use `PrintToString(x)` to convert a value `x` of any type to a 3. You can use `PrintToString(x)` to convert a value `x` of any type to a
string. string.
4. You can use `ExplainMatchResult()` in a custom matcher to wrap another
matcher, for example:
```cpp
MATCHER_P(NestedPropertyMatches, matcher, "") {
return ExplainMatchResult(matcher, arg.nested().property(), result_listener);
}
```
## Actions {#ActionList} ## Actions {#ActionList}