diff options
author | Abseil Team <absl-team@google.com> | 2023-01-25 18:03:30 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-01-25 18:04:20 (GMT) |
commit | 643862d8adb333eae9f3ff288895314dfcc87587 (patch) | |
tree | 484727c818a91af177e1779615e494737b0bd74a /docs | |
parent | d1ad27e0a4ba67161f554da25c5f281ec1e94c44 (diff) | |
download | googletest-643862d8adb333eae9f3ff288895314dfcc87587.zip googletest-643862d8adb333eae9f3ff288895314dfcc87587.tar.gz googletest-643862d8adb333eae9f3ff288895314dfcc87587.tar.bz2 |
Mention `DescribeMatcher` in matchers.md
PiperOrigin-RevId: 504591836
Change-Id: I48c93490d0c3b7c6bfaceceb1cef5eedeacfe6c6
Diffstat (limited to 'docs')
-rw-r--r-- | docs/reference/matchers.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/reference/matchers.md b/docs/reference/matchers.md index 9fb1592..be96281 100644 --- a/docs/reference/matchers.md +++ b/docs/reference/matchers.md @@ -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); + } + ``` |