Browse Source

core: more tests for hashed_string (code coverage)

Michele Caini 5 years ago
parent
commit
80a0e47f1a
1 changed files with 10 additions and 0 deletions
  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_EQ(foo_hs, "foo"_hs);
     ASSERT_NE(bar_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) {
 TEST(HashedString, Empty) {