Make filters compile. Add some filter tests.

This commit is contained in:
bakpakin
2016-03-05 13:34:44 -05:00
parent 29158282bd
commit 206361ca38
2 changed files with 62 additions and 65 deletions
+21
View File
@@ -90,6 +90,27 @@ describe('tiny-ecs:', function()
end)
it("Can use functions as subfilters", function()
local f1 = tiny.requireAny('a', 'b', 'c')
local f2 = tiny.requireAll('x', 'y', 'z')
local f = tiny.requireAll(f1, f2)
assert.truthy(f(nil, {
x = true, y = true, z = true, a = true, b = true, c = true
}))
assert.truthy(f(nil, {
x = true, y = true, z = true, a = true
}))
assert.falsy(f(nil, {
x = true, y = true, a = true
}))
assert.falsy(f(nil, {
x = true, y = true, z = true
}))
end)
end)
describe('World:', function()