Axel Meyer 68a0932f8b test: assert template_of getter behavior + bump to v0.3.0
Bump composition dep to 0.3.0 and add 3 assertions covering the new
getter: round-trip template-id on composition.create, loud-error on
nil arg with message-pattern match, nil on raw entity.create handle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-14 11:57:31 +02:00

lib-core.composition-test

Test-lib for lib-core.composition v0.1.0. Follows the P.2.4 Test-Module-Pattern: exports run_tests(ctx) invoked by the engine's --test-libs runner; uses engine.test.* for TAP-style output.

Version: 0.1.0 Lib-ID: lib-core.composition-test Role: test Requires: lib-core.composition v0.1.0 Tags: test, composition

Coverage (14 assertions)

Group Count What
define_template 4 happy-path register, missing-id error, duplicate error, slot-block error (Phase-D trigger)
create 4 returns non-nil handle, override applies, nested-flatten works, template-default survives
list_by_* 3 template-list count, tag-list count, unknown-template empty
destroy 2 template-index grows on second create, shrinks on destroy
list_templates 1 non-empty after define

Run

Headless via the engine's test-libs orchestrator:

~/Projects/Sporel/sporel-engine/build/sporel \
    --test-libs=lib-core.composition-test

(or however the local dev convention runs engine.test.* lib-tests — see engine/scripts/run-tests.sh for the canonical invocation).

Description
No description provided
Readme 34 KiB
Languages
Lua 100%