Fix bug with deactivating Systems. Add test.

This commit is contained in:
bakpakin
2015-03-30 15:22:23 +08:00
parent 22daad2b26
commit c5c27c679c
2 changed files with 15 additions and 1 deletions
+14
View File
@@ -138,6 +138,20 @@ describe('tiny-ecs:', function()
assert.equals(timePassed, 0)
assert.equals(entity1.xform.x, entityTemplate1.xform.x)
end)
it("Disable and Enable Systems", function()
world:setSystemActive(moveSystem, false)
world:setSystemActive(oneTimeSystem, false)
world:update(1)
assert.equals(timePassed, 0)
assert.equals(entity1.xform.x, entityTemplate1.xform.x)
world:setSystemActive(moveSystem, true)
world:setSystemActive(oneTimeSystem, true)
world:update(1)
assert.equals(timePassed, 1)
assert.are_not.equal(entity1.xform.x, entityTemplate1.xform.x)
end)
end)
end)