diff --git a/include/msg/field_matchers.hpp b/include/msg/field_matchers.hpp index 7dcb0524..71d77b3f 100644 --- a/include/msg/field_matchers.hpp +++ b/include/msg/field_matchers.hpp @@ -162,7 +162,8 @@ struct rel_matcher_t { [[nodiscard]] friend constexpr auto tag_invoke(match::implies_t, rel_matcher_t, rel_matcher_t) -> bool { - return RelOp{}(ExpectedValue, OtherValue); + return ExpectedValue == OtherValue or + RelOp{}(ExpectedValue, OtherValue); } template diff --git a/test/msg/field_matchers.cpp b/test/msg/field_matchers.cpp index 31769663..28b01421 100644 --- a/test/msg/field_matchers.cpp +++ b/test/msg/field_matchers.cpp @@ -54,6 +54,12 @@ TEST_CASE("negate not_equal_to", "[field matchers]") { std::is_same_v const>); } +TEST_CASE("less_than X implies less_than Y (X == Y)", "[field matchers]") { + constexpr auto m = msg::less_than_t{}; + constexpr auto n = msg::less_than_t{}; + static_assert(match::implies(m, n)); +} + TEST_CASE("less_than X implies less_than Y (X <= Y)", "[field matchers]") { constexpr auto m = msg::less_than_t{}; constexpr auto n = msg::less_than_t{};