summaryrefslogtreecommitdiff
path: root/docs/reference/matchers.md
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2021-06-29 21:55:02 -0400
committerAndy Soffer <asoffer@google.com>2021-06-30 13:33:57 -0400
commit4ec4cd23f486bf70efcc5d2caa40f24368f752e3 (patch)
treec074bfc531a1e6763297cb11891af2f3931b7179 /docs/reference/matchers.md
parent5f97ce4c70b888a5a338a93c6f642d8ee6ddcded (diff)
downloadgoogletest-git-4ec4cd23f486bf70efcc5d2caa40f24368f752e3.tar.gz
Googletest export
Implement 'Contains(e).Times(n)' matcher modifier which allows to test for arbitrary occurrences including absence with Times(0). PiperOrigin-RevId: 382210276
Diffstat (limited to 'docs/reference/matchers.md')
-rw-r--r--docs/reference/matchers.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/reference/matchers.md b/docs/reference/matchers.md
index 8697060d..0d8f81be 100644
--- a/docs/reference/matchers.md
+++ b/docs/reference/matchers.md
@@ -116,6 +116,7 @@ messages, you can use:
| `BeginEndDistanceIs(m)` | `argument` is a container whose `begin()` and `end()` iterators are separated by a number of increments matching `m`. E.g. `BeginEndDistanceIs(2)` or `BeginEndDistanceIs(Lt(2))`. For containers that define a `size()` method, `SizeIs(m)` may be more efficient. |
| `ContainerEq(container)` | The same as `Eq(container)` except that the failure message also includes which elements are in one container but not the other. |
| `Contains(e)` | `argument` contains an element that matches `e`, which can be either a value or a matcher. |
+| `Contains(e).Times(n)` | `argument` contains elements that match `e`, which can be either a value or a matcher, and the number of matches is `n`, which can be either a value or a matcher. Unlike the plain `Contains` and `Each` this allows to check for arbitrary occurrences including testing for absence with `Contains(e).Times(0)`. |
| `Each(e)` | `argument` is a container where *every* element matches `e`, which can be either a value or a matcher. |
| `ElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, where the *i*-th element matches `ei`, which can be a value or a matcher. |
| `ElementsAreArray({e0, e1, ..., en})`, `ElementsAreArray(a_container)`, `ElementsAreArray(begin, end)`, `ElementsAreArray(array)`, or `ElementsAreArray(array, count)` | The same as `ElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, iterator range, or C-style array. |