Googletest export
Address OSS Issue #2463 https://github.com/google/googletest/issues/2463 PiperOrigin-RevId: 333289989
This commit is contained in:
@@ -1132,10 +1132,11 @@ Hamcrest project, which adds `assertThat()` to JUnit.
|
||||
|
||||
### Using Predicates as Matchers
|
||||
|
||||
gMock provides a [built-in set](#MatcherList) of matchers. In case you find them
|
||||
lacking, you can use an arbitrary unary predicate function or functor as a
|
||||
matcher - as long as the predicate accepts a value of the type you want. You do
|
||||
this by wrapping the predicate inside the `Truly()` function, for example:
|
||||
gMock provides a [built-in set](cheat_sheet.md#MatcherList) of matchers. In case
|
||||
you find them lacking, you can use an arbitrary unary predicate function or
|
||||
functor as a matcher - as long as the predicate accepts a value of the type you
|
||||
want. You do this by wrapping the predicate inside the `Truly()` function, for
|
||||
example:
|
||||
|
||||
```cpp
|
||||
using ::testing::Truly;
|
||||
|
||||
Reference in New Issue
Block a user