Calic c590196b70 test: pcall-wrap panel-spy restoration in section 12
Wraps the section-12 test body in pcall so the panel-spy
restoration runs unconditionally. Prevents spy-state leaking into
subsequent tests if section-12 fails.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-14 19:53:05 +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%