From 03666c9b615a00fe14f47b854830752db1a90e3e Mon Sep 17 00:00:00 2001 From: lolmanurfunny <77128366+lolmanurfunny@users.noreply.github.com> Date: Tue, 11 Mar 2025 15:39:30 -0400 Subject: [PATCH] test case --- test/tests.luau | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/tests.luau b/test/tests.luau index 504027f..b1615b4 100644 --- a/test/tests.luau +++ b/test/tests.luau @@ -1333,6 +1333,26 @@ TEST("world:target", function() CHECK(i == 10) end + + do CASE("should return correct targets after deletion") -- ISSUE #207 + local world = jecs.World.new() + + local Attacks = world:component() + local Eats = world:component() + local a = world:entity() + local b = world:entity() + local c = world:entity() + + world:add(a, jecs.pair(Attacks, b)) + world:add(a, jecs.pair(Attacks, c)) + world:add(a, jecs.pair(Eats, c)) + world:add(a, jecs.pair(Eats, b)) + world:delete(c) + + CHECK(world:target(a, Attacks, 0) == b) + CHECK(not world:target(a, Attacks, 1)) + CHECK(not world:target(a, Attacks, 2)) + end end) TEST("world:contains", function()