Add some tests.

This commit is contained in:
bakpakin
2015-04-25 18:14:41 +08:00
parent a612a7b13d
commit 9a284ce9da
+18
View File
@@ -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)