Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
More multiple requirements tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed Aug 7, 2016
1 parent 95e2795 commit 4d89f35
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/engine_entity_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,20 @@ describe('Engine', function()
assert.True(#multiSystem.targets['name2'] == 0)
end)

it('Entity:remove() removes entity from system with multiple requirements', function()
entity:add(Component1())
entity:add(Component2())
engine:addEntity(entity)
engine:addSystem(multiSystem)
assert.are.equal(multiSystem.targets['name1'][1], entity)
assert.are.equal(multiSystem.targets['name2'][1], entity)

engine:removeEntity(entity)
assert.True(#multiSystem.targets['name1'] == 0)
assert.True(#multiSystem.targets['name2'] == 0)
end)


it(':getRootEntity() gets rootEntity', function()
assert.are.equal(engine:getRootEntity(), engine.rootEntity)
end)
Expand Down

0 comments on commit 4d89f35

Please sign in to comment.