From f9b589547ba83afc4fe2f7c18ec2a54f404e6e6b Mon Sep 17 00:00:00 2001 From: Ukendio Date: Tue, 22 Apr 2025 04:23:16 +0200 Subject: [PATCH] Add test cases for preregistered tags --- test/tests.luau | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/tests.luau b/test/tests.luau index 1aea9e1..16f21d6 100644 --- a/test/tests.luau +++ b/test/tests.luau @@ -22,6 +22,7 @@ type Entity = jecs.Entity type Id = jecs.Id local entity_visualiser = require("@tools/entity_visualiser") +local lifetime_tracker_add = require("@tools/lifetime_tracker") local dwi = entity_visualiser.stringify TEST("world:add()", function() @@ -246,6 +247,7 @@ TEST("world:component()", function() end) TEST("world:contains()", function() + local tag = jecs.tag() local world = jecs.world() local id = world:entity() CHECK(world:contains(id)) @@ -255,6 +257,9 @@ TEST("world:contains()", function() world:delete(id) CHECK(not world:contains(id)) end + + CHECK(world:contains(tag)) + jecs.ECS_META_RESET() end) TEST("world:delete()", function() @@ -628,6 +633,7 @@ end) TEST("world:entity()", function() local N = 2^8 + do CASE "unique IDs" local world = jecs.world() local set = {} @@ -1427,8 +1433,6 @@ TEST("#adding a recycled target", function() end) - - TEST("#repro2", function() local world = jecs.world() local Lifetime = world:component() :: Id