diff --git a/ecs_tests.cpp b/ecs_tests.cpp index ad3184e..b3be859 100644 --- a/ecs_tests.cpp +++ b/ecs_tests.cpp @@ -71,6 +71,7 @@ TEST_CASE("detail") { REQUIRE(s.has(42u)); REQUIRE_FALSE(s.has(84u)); + REQUIRE(s.find(42u) == s.begin()); REQUIRE(s.find_index(42u).second); REQUIRE(s.find_index(42u).first == 0u); REQUIRE(s.get_index(42u) == 0u); @@ -231,6 +232,14 @@ TEST_CASE("registry") { REQUIRE_FALSE(w.destroy_entity(e1)); REQUIRE_FALSE(w.destroy_entity(e2)); } + { + ecs::registry w; + + const auto e1 = w.create_entity(); + w.destroy_entity(e1); + const auto e2 = w.create_entity(); + REQUIRE(e1 == e2); + } } SECTION("component_assigning") { { @@ -355,6 +364,14 @@ TEST_CASE("registry") { REQUIRE_FALSE(ww.find_component(e2)); } } + { + ecs::registry w; + auto e1 = w.create_entity(); + e1.assign_component(1, 2); + e1.assign_component(3, 4); + REQUIRE(e1.get_component().x == 3); + REQUIRE(e1.get_component().y == 4); + } { ecs::registry w;