Custom output when RangeEquals fails
Open
- Dominant language
- C++
- Stars
- 21.5k
- Forks
- 3.5k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
**Description**
I am comparing two arrays for point-wise equality and would like to have a simple custom error message.
For instance, count of mismatched elements and a few first mismatches. How can this be achieved?
**Additional context**
Currently I have the code below, and on error it dumps entire spans, and it's hard to see which elements do not match.
```
int n;
int* expected; // size [n]
int* result; // size [n]
REQUIRE_THAT(std::span(result, n), Catch::Matchers::RangeEquals(std::span(expected, n)));
```
Contributor guide
Assessment
This issue has not been assessed yet.