mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
set hook before usage
Some checks failed
Some checks failed
This commit is contained in:
parent
b26fc39fce
commit
db1b29fa04
1 changed files with 3 additions and 2 deletions
|
@ -1473,11 +1473,12 @@ TEST("Hooks", function()
|
||||||
local world = jecs.World.new()
|
local world = jecs.World.new()
|
||||||
local A = world:component() :: Entity<boolean>
|
local A = world:component() :: Entity<boolean>
|
||||||
local e1 = world:entity()
|
local e1 = world:entity()
|
||||||
world:add(e1, A)
|
|
||||||
world:set(A, jecs.OnRemove, function(entity)
|
world:set(A, jecs.OnRemove, function(entity)
|
||||||
CHECK(e1 == entity)
|
CHECK(e1 == entity)
|
||||||
CHECK(not world:has(e1, A))
|
CHECK(world:has(e1, A))
|
||||||
end)
|
end)
|
||||||
|
world:add(e1, A)
|
||||||
|
|
||||||
world:remove(e1, A)
|
world:remove(e1, A)
|
||||||
CHECK(not world:has(e1, A))
|
CHECK(not world:has(e1, A))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue