mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-21 23:56:50 -06:00
Add some tests.
This commit is contained in:
@@ -179,6 +179,24 @@ describe('tiny-ecs:', function()
|
|||||||
assert.equals(0, world:getEntityCount())
|
assert.equals(0, world:getEntityCount())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("Add Systems Multiple Times", function()
|
||||||
|
world:update(1)
|
||||||
|
world:add(moveSystem, oneTimeSystem)
|
||||||
|
world:update(2)
|
||||||
|
assert.equals(2, world:getSystemCount())
|
||||||
|
assert.equals(3, world:getEntityCount())
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("Remove Systems Multiple Times", function()
|
||||||
|
world:update(1)
|
||||||
|
world:remove(moveSystem)
|
||||||
|
world:update(2)
|
||||||
|
world:remove(moveSystem)
|
||||||
|
world:update(2)
|
||||||
|
assert.equals(1, world:getSystemCount())
|
||||||
|
assert.equals(3, world:getEntityCount())
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user