From 23491e38951a6ebfb85aa9af07fc70651d210ff0 Mon Sep 17 00:00:00 2001 From: 1Axen Date: Tue, 9 Sep 2025 05:45:26 +0300 Subject: [PATCH] Add test case --- test/tests.luau | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/tests.luau b/test/tests.luau index 76e8181..dfc0d84 100755 --- a/test/tests.luau +++ b/test/tests.luau @@ -330,6 +330,20 @@ TEST("bulk", function() CHECK(world:get(e, c2) == 123) CHECK(world:get(e, c3) == "hello") end + + do CASE "Should ensure archetype ids are sorted" + local world = jecs.world() + local c1, c2, c3 = world:component(), world:component(), world:component() + + local e = world:entity() + jecs.bulk_insert(world, e, { c2, c1 }, { 2, 1 }) + jecs.bulk_insert(world, e, { c1 }, { 1 }) + world:set(e, c3, 3) + + CHECK(world:get(e, c1) == 1) + CHECK(world:get(e, c2) == 2) + CHECK(world:get(e, c3) == 3) + end end) TEST("repro", function()