Răsfoiți Sursa

core: more tests for hashed_string (code coverage)

Michele Caini 5 ani în urmă
părinte
comite
80a0e47f1a
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      test/entt/core/hashed_string.cpp

+ 10 - 0
test/entt/core/hashed_string.cpp

@@ -34,6 +34,16 @@ TEST(HashedString, Functionalities) {
 
     ASSERT_EQ(foo_hs, "foo"_hs);
     ASSERT_NE(bar_hs, "foo"_hs);
+
+    entt::hashed_string empty_hs{};
+
+    ASSERT_EQ(empty_hs, entt::hashed_string{});
+    ASSERT_NE(empty_hs, foo_hs);
+
+    empty_hs = foo_hs;
+
+    ASSERT_NE(empty_hs, entt::hashed_string{});
+    ASSERT_EQ(empty_hs, foo_hs);
 }
 
 TEST(HashedString, Empty) {