Point from the "Defining Matchers" section in the reference doc to the cookbook, which is much more detailed.

PiperOrigin-RevId: 852639172
Change-Id: Ia39a01702c7c64404950a1be19b1ebdfdff8f010
This commit is contained in:
Abseil Team
2026-01-06 00:09:54 -08:00
committed by Copybara-Service
parent 9156d4caac
commit 76cd89bcf1
2 changed files with 12 additions and 3 deletions
+9
View File
@@ -1,5 +1,7 @@
# Matchers Reference
<!-- disableFinding(LINK_RELATIVE_G3DOC) -->
A **matcher** matches a *single* argument. You can use it inside `ON_CALL()` or
`EXPECT_CALL()`, or use it to validate a value directly using two macros:
@@ -297,6 +299,13 @@ which must be a permanent callback.
## Defining Matchers
{: .callout .note}
Note: full details about defining new matchers are in the
[cookbook](../gmock_cook_book.md#NewMatchers). In particular, if `MATCHER`
macros are not sufficient, you can directly implement
[monomorphic](../gmock_cook_book.md#MonomorphicMatchers) or
[polymorphic](../gmock_cook_book.md#PolymorphicMatchers) matchers.
| Macro | Description |
| :----------------------------------- | :------------------------------------ |
| `MATCHER(IsEven, "") { return (arg % 2) == 0; }` | Defines a matcher `IsEven()` to match an even number. |