Skip to content

Commit 7a3d88a

Browse files
authored
Merge branch 'main' into Fix-invalidation-error
2 parents bc0a9bf + 76d1ff9 commit 7a3d88a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/init.luau

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ do
670670
end
671671

672672
local world_has: (world: World, entityId: number, ...i53) -> boolean
673+
673674
do
674675
function world_has(world, entity_id, ...)
675676
local id = entity_id

test/tests.luau

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,34 @@ TEST("world", function()
530530

531531
CHECK(withoutCount == 0)
532532
end
533+
534+
do CASE "should find Tag on entity"
535+
local world = jecs.World.new()
536+
537+
local Tag = world:component()
538+
539+
local e = world:entity()
540+
world:add(e, Tag)
541+
542+
CHECK(world:has(e, Tag))
543+
end
544+
545+
do CASE "should return false when missing one tag"
546+
local world = jecs.World.new()
547+
548+
local A = world:component()
549+
local B = world:component()
550+
local C = world:component()
551+
local D = world:component()
552+
553+
local e = world:entity()
554+
world:add(e, A)
555+
world:add(e, C)
556+
world:add(e, D)
557+
558+
CHECK(world:has(e, A, B, C, D) == false)
559+
end
560+
533561
end)
534562

535563

0 commit comments

Comments
 (0)