Fix a bug in UnorderedEqualsMatcher

Previously a mismatched prefix would be skipped before the actual
comparison would be performed. Obviously, it is supposed to be
_matching_ prefix that is skipped.
This commit is contained in:
Martin Hořeňovský
2018-09-28 15:30:00 +02:00
parent 558bbe7d24
commit be49a539e4
7 changed files with 42 additions and 8 deletions

View File

@@ -423,6 +423,15 @@ namespace { namespace MatchersTests {
}
}
TEST_CASE("Regression test #1", "[matchers][vector]") {
// At some point, UnorderedEqualsMatcher skipped
// mismatched prefixed before doing the comparison itself
std::vector<char> actual = { 'a', 'b' };
std::vector<char> expected = { 'c', 'b' };
CHECK_THAT(actual, !UnorderedEquals(expected));
}
} } // namespace MatchersTests
#endif // CATCH_CONFIG_DISABLE_MATCHERS