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:
committed by
Copybara-Service
parent
9156d4caac
commit
76cd89bcf1
@@ -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. |
|
||||
|
||||
Reference in New Issue
Block a user