compare ops hashed_string with string_view

This commit is contained in:
BlackMATov
2023-02-03 02:17:25 +07:00
parent 0a4ba7b128
commit 2c9dc25e9d
3 changed files with 13 additions and 0 deletions

View File

@@ -77,12 +77,17 @@ TEST_CASE("meta/meta_base/hashed_string") {
constexpr hashed_string hs2{"hello"};
static_assert(!(hs1 < hs2) && !(hs2 < hs1));
static_assert(hs1 < hashed_string{"world"} || hashed_string{"world"} < hs1);
static_assert((hs1 < "world" || hs1 > "world"));
static_assert(("world" < hs1 || "world" > hs1));
}
SUBCASE("operator==") {
constexpr hashed_string hs1{"hello"};
static_assert(hs1 == hashed_string{"hello"});
static_assert(hs1 != hashed_string{"world"});
static_assert(hs1 == "hello");
static_assert("hello" == hs1);
static_assert("world" != hs1);
}
SUBCASE("swap") {