mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Add null query unit test
This commit is contained in:
parent
97d6955da0
commit
1eb44b000f
1 changed files with 16 additions and 0 deletions
|
@ -471,6 +471,22 @@ TEST("world", function()
|
||||||
CHECK(world:get(e, B) == false)
|
CHECK(world:get(e, B) == false)
|
||||||
CHECK(world:get(e, C) == "hello world")
|
CHECK(world:get(e, C) == "hello world")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
do CASE "should not iterate when nothing matches query"
|
||||||
|
local world = jecs.World.new()
|
||||||
|
local A = world:component()
|
||||||
|
local B = world:component()
|
||||||
|
|
||||||
|
local e1 = world:entity()
|
||||||
|
world:add(e1, A)
|
||||||
|
|
||||||
|
local count = 0
|
||||||
|
for id in world:query(B) do
|
||||||
|
count += 1
|
||||||
|
end
|
||||||
|
|
||||||
|
CHECK(count == 0)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
FINISH()
|
FINISH()
|
||||||
|
|
Loading…
Reference in a new issue