From 425957dc63a6dd52234438c6038b901029c71372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 27 Jul 2019 18:41:42 +0200 Subject: [PATCH] Update vector matcher documentation As it turns out, there were 2 undocumented vector matchers. I also improved the documentation of them all. Closes #1699 --- 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.