diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index 674d7e00c..98cc5fb77 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -1100,6 +1100,21 @@ TEST(Registry, EmplaceOrReplace) { ASSERT_EQ(ref, 0); } +TEST(Registry, EmplaceOrReplaceEmpty) { + entt::registry registry{}; + const auto entity = registry.create(); + + ASSERT_FALSE(registry.all_of(entity)); + + registry.emplace_or_replace(entity); + + ASSERT_TRUE(registry.all_of(entity)); + + registry.emplace_or_replace(entity); + + ASSERT_EQ(registry.storage().size(), 1u); +} + TEST(Registry, EmplaceOrReplaceAggregate) { entt::registry registry{}; const auto entity = registry.create();