Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/msg/field_matchers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ struct rel_matcher_t {
[[nodiscard]] friend constexpr auto
tag_invoke(match::implies_t, rel_matcher_t,
rel_matcher_t<RelOp, Field, OtherValue>) -> bool {
return RelOp{}(ExpectedValue, OtherValue);
return ExpectedValue == OtherValue or
RelOp{}(ExpectedValue, OtherValue);
}

template <typename Msg>
Expand Down
6 changes: 6 additions & 0 deletions test/msg/field_matchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ TEST_CASE("negate not_equal_to", "[field matchers]") {
std::is_same_v<decltype(n), msg::equal_to_t<test_field, 5> const>);
}

TEST_CASE("less_than X implies less_than Y (X == Y)", "[field matchers]") {
constexpr auto m = msg::less_than_t<test_field, 5>{};
constexpr auto n = msg::less_than_t<test_field, 5>{};
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<test_field, 5>{};
constexpr auto n = msg::less_than_t<test_field, 6>{};
Expand Down