mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Add faíling test
This commit is contained in:
parent
05e00417e4
commit
409ca97704
1 changed files with 24 additions and 1 deletions
|
@ -408,7 +408,7 @@ TEST("world", function()
|
|||
CHECK(count == 5)
|
||||
end
|
||||
|
||||
do CASE "should not overpopulate archetypes from A and AB"
|
||||
do CASE "should allow adding a matching entity during iteration"
|
||||
local world = jecs.World.new()
|
||||
local A = world:component()
|
||||
local B = world:component()
|
||||
|
@ -429,6 +429,29 @@ TEST("world", function()
|
|||
|
||||
CHECK(count == 3)
|
||||
end
|
||||
|
||||
|
||||
do CASE "should not iterate same entity when adding component"
|
||||
local world = jecs.World.new()
|
||||
local A = world:component()
|
||||
local B = world:component()
|
||||
|
||||
local e1 = world:entity()
|
||||
local e2 = world:entity()
|
||||
world:add(e1, A)
|
||||
world:add(e2, A)
|
||||
world:add(e2, B)
|
||||
|
||||
local count = 0
|
||||
for id in world:query(A) do
|
||||
world:add(id, B)
|
||||
|
||||
count += 1
|
||||
end
|
||||
|
||||
print(count)
|
||||
CHECK(count == 2)
|
||||
end
|
||||
end)
|
||||
|
||||
FINISH()
|
||||
|
|
Loading…
Reference in a new issue