diff options
| author | Raphael Schaller | 2021-11-14 17:05:31 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-07-16 16:16:05 +0200 |
| commit | 1bd233866c5ba1d94fbea34b260685b4b4ecb796 (patch) | |
| tree | f12a6ec27174d50af450a537ed49f006de505301 /docs | |
| parent | f993b702c694211690a01de19e6d9eaa9912cae8 (diff) | |
| download | catch3-1bd233866c5ba1d94fbea34b260685b4b4ecb796.tar.gz | |
Add AllTrue, AnyTrue, NoneTrue matchers
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/matchers.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/matchers.md b/docs/matchers.md index 3d0f8f11..0060bfd1 100644 --- a/docs/matchers.md +++ b/docs/matchers.md @@ -258,6 +258,12 @@ definitions to handle generic range-like types. These are: * `SizeIs(Matcher size_matcher)` * `Contains(T&& target_element, Comparator = std::equal_to<>{})` * `Contains(Matcher element_matcher)` +* `AllMatch(Matcher element_matcher)` +* `NoneMatch(Matcher element_matcher)` +* `AnyMatch(Matcher element_matcher)` +* `AllTrue()` +* `NoneTrue()` +* `AnyTrue()` `IsEmpty` should be self-explanatory. It successfully matches objects that are empty according to either `std::empty`, or ADL-found `empty` @@ -275,6 +281,14 @@ the target element. The other variant is constructed from a matcher, in which case a range is accepted if any of its elements is accepted by the provided matcher. +`AllMatch`, `NoneMatch`, and `AnyMatch` match ranges for which either +all, none, or any of the contained elements matches the given matcher, +respectively. + +`AllTrue`, `NoneTrue`, and `AnyTrue` match ranges for which either +all, none, or any of the contained elements are `true`, respectively. +It works for ranges of `bool`s and ranges of elements (explicitly) +convertible to `bool`. ## Writing custom matchers (old style) |