Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Update vector matcher documentation

As it turns out, there were 2 undocumented vector matchers. I also
improved the documentation of them all.

Closes #1699
Commit
425957dc63a6dd52234438c6038b901029c71372
Author
Martin Hořeňovský ·
Parents
d017f6d18fcd

Files · Download .tar.gz

Changes

 docs/matchers.md | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/matchers.md b/docs/matchers.md
index 13c7d0c8..f0fe06a2 100644
--- a/docs/matchers.md
+++ b/docs/matchers.md
@@ -45,7 +45,16 @@ Each of the provided `std::string` matchers also takes an optional second argume
 
 
 ### Vector matchers
-The vector matchers are `Contains`, `VectorContains` and `Equals`. `VectorContains` looks for a single element in the matched vector, `Contains` looks for a set (vector) of elements inside the matched vector.
+Catch2 currently provides 5 built-in matchers that work on `std::vector`.
+These are
+
+ * `Contains` which checks whether a specified vector is present in the result
+ * `VectorContains` which checks whether a specified element is present in the result
+ * `Equals` which checks whether the result is exactly equal (order matters) to a specific vector
+ * `UnorderedEquals` which checks whether the result is equal to a specific vector under a permutation
+ * `Approx` which checks whether the result is "approx-equal" (order matters, but comparison is done via `Approx`) to a specific vector
+> Approx matcher was [introduced](https://github.com/catchorg/Catch2/issues/1499) in Catch 2.7.2.
+
 
 ### Floating point matchers
 The floating point matchers are `WithinULP` and `WithinAbs`. `WithinAbs` accepts floating point numbers that are within a certain margin of target. `WithinULP` performs an [ULP](https://en.wikipedia.org/wiki/Unit_in_the_last_place)-based comparison of two floating point numbers and accepts them if they are less than certain number of ULPs apart.