summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2021-02-17 09:48:06 (GMT)
committerDerek Mauro <dmauro@google.com>2021-02-18 18:27:08 (GMT)
commit7fb047bca335375a47ee0c4cddf4ffd92ac02673 (patch)
tree6519cfbd6dee2093b7517c75f62d3c94b1f91586 /docs
parent58937787164c94d609af8a326a19cb3e3dfb630c (diff)
downloadgoogletest-7fb047bca335375a47ee0c4cddf4ffd92ac02673.zip
googletest-7fb047bca335375a47ee0c4cddf4ffd92ac02673.tar.gz
googletest-7fb047bca335375a47ee0c4cddf4ffd92ac02673.tar.bz2
Googletest export
Explain how to wrap matchers. PiperOrigin-RevId: 357901293
Diffstat (limited to 'docs')
-rw-r--r--docs/gmock_cheat_sheet.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/gmock_cheat_sheet.md b/docs/gmock_cheat_sheet.md
index b05c8a5..c82d9cc 100644
--- a/docs/gmock_cheat_sheet.md
+++ b/docs/gmock_cheat_sheet.md
@@ -477,6 +477,14 @@ which must be a permanent callback.
being matched and the matcher parameters).
3. You can use `PrintToString(x)` to convert a value `x` of any type to a
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}