mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user