mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Add test cases for preregistered tags
This commit is contained in:
parent
9c915e131b
commit
f9b589547b
1 changed files with 6 additions and 2 deletions
|
@ -22,6 +22,7 @@ type Entity<T=nil> = jecs.Entity<T>
|
||||||
type Id<T=unknown> = jecs.Id<T>
|
type Id<T=unknown> = jecs.Id<T>
|
||||||
|
|
||||||
local entity_visualiser = require("@tools/entity_visualiser")
|
local entity_visualiser = require("@tools/entity_visualiser")
|
||||||
|
local lifetime_tracker_add = require("@tools/lifetime_tracker")
|
||||||
local dwi = entity_visualiser.stringify
|
local dwi = entity_visualiser.stringify
|
||||||
|
|
||||||
TEST("world:add()", function()
|
TEST("world:add()", function()
|
||||||
|
@ -246,6 +247,7 @@ TEST("world:component()", function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
TEST("world:contains()", function()
|
TEST("world:contains()", function()
|
||||||
|
local tag = jecs.tag()
|
||||||
local world = jecs.world()
|
local world = jecs.world()
|
||||||
local id = world:entity()
|
local id = world:entity()
|
||||||
CHECK(world:contains(id))
|
CHECK(world:contains(id))
|
||||||
|
@ -255,6 +257,9 @@ TEST("world:contains()", function()
|
||||||
world:delete(id)
|
world:delete(id)
|
||||||
CHECK(not world:contains(id))
|
CHECK(not world:contains(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
CHECK(world:contains(tag))
|
||||||
|
jecs.ECS_META_RESET()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
TEST("world:delete()", function()
|
TEST("world:delete()", function()
|
||||||
|
@ -628,6 +633,7 @@ end)
|
||||||
|
|
||||||
TEST("world:entity()", function()
|
TEST("world:entity()", function()
|
||||||
local N = 2^8
|
local N = 2^8
|
||||||
|
|
||||||
do CASE "unique IDs"
|
do CASE "unique IDs"
|
||||||
local world = jecs.world()
|
local world = jecs.world()
|
||||||
local set = {}
|
local set = {}
|
||||||
|
@ -1427,8 +1433,6 @@ TEST("#adding a recycled target", function()
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST("#repro2", function()
|
TEST("#repro2", function()
|
||||||
local world = jecs.world()
|
local world = jecs.world()
|
||||||
local Lifetime = world:component() :: Id<number>
|
local Lifetime = world:component() :: Id<number>
|
||||||
|
|
Loading…
Reference in a new issue