diff options
| author | Martin Hořeňovský | 2023-03-05 00:11:07 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-03-05 00:11:38 +0100 |
| commit | 0a0ebf50034831718ffc63c6d12abb1fa469d6e9 (patch) | |
| tree | f4635427c6bc9ef08094852827a20d92f398588b /src/catch2 | |
| parent | 69f35a5ac8ee4cb60dce7afe6978f10871baa718 (diff) | |
| download | catch3-0a0ebf50034831718ffc63c6d12abb1fa469d6e9.tar.gz | |
Support elements without op!= in VectorEquals
Closes #2648
Diffstat (limited to 'src/catch2')
| -rw-r--r-- | src/catch2/matchers/catch_matchers_vector.hpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/catch2/matchers/catch_matchers_vector.hpp b/src/catch2/matchers/catch_matchers_vector.hpp index 9a4b024f..fffbfdf6 100644 --- a/src/catch2/matchers/catch_matchers_vector.hpp +++ b/src/catch2/matchers/catch_matchers_vector.hpp @@ -85,11 +85,10 @@ namespace Matchers { // - a more general approach would be via a compare template that defaults // to using !=. but could be specialised for, e.g. std::vector<T> etc // - then just call that directly - if (m_comparator.size() != v.size()) - return false; - for (std::size_t i = 0; i < v.size(); ++i) - if (m_comparator[i] != v[i]) - return false; + if ( m_comparator.size() != v.size() ) { return false; } + for ( std::size_t i = 0; i < v.size(); ++i ) { + if ( !( m_comparator[i] == v[i] ) ) { return false; } + } return true; } std::string describe() const override { |