Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
df94fc5f
Commit
df94fc5f
authored
Sep 23, 2020
by
Abseil Team
Committed by
vslashg
Sep 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Address OSS Issue #2463
https://github.com/google/googletest/issues/2463
PiperOrigin-RevId: 333289989
parent
634c52d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
cook_book.md
googlemock/docs/cook_book.md
+5
-4
advanced.md
googletest/docs/advanced.md
+5
-3
No files found.
googlemock/docs/cook_book.md
View file @
df94fc5f
...
...
@@ -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
;
...
...
googletest/docs/advanced.md
View file @
df94fc5f
...
...
@@ -371,9 +371,11 @@ Verifies that `val1` is less than, or almost equal to, `val2`. You can replace
### Asserting Using gMock Matchers
[
gMock
](
../../googlemock
)
comes with a library of matchers for validating
arguments passed to mock objects. A gMock
*matcher*
is basically a predicate
that knows how to describe itself. It can be used in these assertion macros:
[
gMock
](
../../googlemock
)
comes with
[
a library of matchers
](
../../googlemock/docs/cheat_sheet.md#MatcherList
)
for
validating arguments passed to mock objects. A gMock
*matcher*
is basically a
predicate that knows how to describe itself. It can be used in these assertion
macros:
<!-- mdformat off(github rendering does not support multiline tables) -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment