From 9a284ce9da02ae35d2a3d54e22ea03295768ef72 Mon Sep 17 00:00:00 2001 From: bakpakin Date: Sat, 25 Apr 2015 18:14:41 +0800 Subject: [PATCH] Add some tests. --- spec/tiny_spec.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/tiny_spec.lua b/spec/tiny_spec.lua index 40660ae..23bba4b 100644 --- a/spec/tiny_spec.lua +++ b/spec/tiny_spec.lua @@ -179,6 +179,24 @@ describe('tiny-ecs:', function() assert.equals(0, world:getEntityCount()) 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)