Calic 6f9ceebe66 test: v0.2.0 locale_factory + ctx_inner alias assertions
Three new TAP cases cover the locale_factory rollout:

- §10 Form-1 bw-compat: display.create(container) wraps the bare
  handle as a constant locale_factory; _test_get_locale returns the
  same handle, _test_get_rows still resolves single-source
  availability via the Form-1 shim.
- §11 Form-2 locale-factory: display.create(function() -> {sources,
  sink}) returns the locale table per frame; a recipe needing two
  templates split across two source-containers reports aggregate
  availability=true.
- §12 ctx_inner propagation: monkey-patching panel.show_context_menu
  captures the entries-table, then invokes the action callback with
  a dummy menu_ctx. Asserts ctx_inner.locale matches the resolved
  locale and ctx_inner.container points at locale.sink (Form-2) or
  the bare handle (Form-1).

Test count grows 9 -> 12. Added a fresh_container helper so the
multi-container fixtures in §11/§12 do not lose recipes via repeated
_test_clear_all calls.

Depends on lib-core.crafting-display v0.2.0 and lib-core.crafting
v0.2.0.

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

lib-core.crafting-display-test

Test module for lib-core.crafting-display. Runs 8 assertions headless via engine.test.* (TAP output).

Version: 0.1.0 Lib-ID: lib-core.crafting-display-test Role: test Requires: lib-core.crafting-display v0.1.0, lib-core.crafting v0.1.0, lib-core.panel v0.1.1, lib-core.inventory-list v0.1.0, lib-core.composition v0.3.0

All transitive deps are declared directly per engine's per-module non-transitive resolver.

Running

export PATH="/c/msys64/mingw64/bin:$PATH"
cd ~/Projects/Sporel/sporel-engine
SPOREL_LOG_STDERR=1 \
    ./build/Sporel.exe \
    --test-libs=lib-core.crafting-display-test \
    --libs-dir=/c/Games/Sporel/libs 2>&1 | tail -15

Expected: pass=8 fail=0.

Assertions

  1. create(container, opts) returns widget_def with render, handle_input, and correct title
  2. register_action + unregister_action round-trip: action-count goes 0 -> 1 -> 0
  3. Duplicate action label -> Loud-Error matching crafting-display.register_action.*duplicate
  4. Non-function callback -> Loud-Error matching crafting-display.register_action.*callback
  5. Default action-set is empty directly after create
  6. Rows filtered via is_known: only known recipes appear in _test_get_rows
  7. Per-row availability flag matches can_craft.ok (true for satisfied inputs, false otherwise)
  8. Resolver overrides (set_icon_resolver / set_label_resolver / set_summary_resolver) actually take effect
Description
No description provided
Readme 46 KiB
Languages
Lua 100%