mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
test case
This commit is contained in:
parent
e2ea71a7fe
commit
03666c9b61
1 changed files with 20 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue