diff options
author | Abseil Team <absl-team@google.com> | 2021-06-30 01:55:02 (GMT) |
---|---|---|
committer | Andy Soffer <asoffer@google.com> | 2021-06-30 17:33:57 (GMT) |
commit | 4ec4cd23f486bf70efcc5d2caa40f24368f752e3 (patch) | |
tree | c074bfc531a1e6763297cb11891af2f3931b7179 /docs | |
parent | 5f97ce4c70b888a5a338a93c6f642d8ee6ddcded (diff) | |
download | googletest-4ec4cd23f486bf70efcc5d2caa40f24368f752e3.zip googletest-4ec4cd23f486bf70efcc5d2caa40f24368f752e3.tar.gz googletest-4ec4cd23f486bf70efcc5d2caa40f24368f752e3.tar.bz2 |
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')
-rw-r--r-- | docs/reference/matchers.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/reference/matchers.md b/docs/reference/matchers.md index 8697060..0d8f81b 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. | |