We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d15012 commit fc01149Copy full SHA for fc01149
test/entt/entity/registry.cpp
@@ -1100,6 +1100,21 @@ TEST(Registry, EmplaceOrReplace) {
1100
ASSERT_EQ(ref, 0);
1101
}
1102
1103
+TEST(Registry, EmplaceOrReplaceEmpty) {
1104
+ entt::registry registry{};
1105
+ const auto entity = registry.create();
1106
+
1107
+ ASSERT_FALSE(registry.all_of<test::empty>(entity));
1108
1109
+ registry.emplace_or_replace<test::empty>(entity);
1110
1111
+ ASSERT_TRUE(registry.all_of<test::empty>(entity));
1112
1113
1114
1115
+ ASSERT_EQ(registry.storage<test::empty>().size(), 1u);
1116
+}
1117
1118
TEST(Registry, EmplaceOrReplaceAggregate) {
1119
entt::registry registry{};
1120
const auto entity = registry.create();
0 commit comments