6f9ceebe66947c4a71142ccc689518aa9a442c2f
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>
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
create(container, opts)returns widget_def withrender,handle_input, and correcttitleregister_action+unregister_actionround-trip: action-count goes 0 -> 1 -> 0- Duplicate action label -> Loud-Error matching
crafting-display.register_action.*duplicate - Non-function callback -> Loud-Error matching
crafting-display.register_action.*callback - Default action-set is empty directly after
create - Rows filtered via
is_known: only known recipes appear in_test_get_rows - Per-row availability flag matches
can_craft.ok(true for satisfied inputs, false otherwise) - Resolver overrides (
set_icon_resolver/set_label_resolver/set_summary_resolver) actually take effect
Description
Languages
Lua
100%