b88842161c737d3d0a9bbe59cdbb60dd8451bd20
Adds a 9th assertion that drives widget.render(ctx) with a stub ctx shaped per lib-core.panel's widget-lifecycle contract (bounds, theme with packed-RGBA colours and font_size_body, is_focused) and verifies the widget populates _render_rows correctly. Catches future drift between this widget and the panel API. engine.render.draw_text is registered but errors in test_mode (no OpenGL context); the assertion stubs it for the duration of the render call so the layout pass runs to completion without coupling to the rendering backend. 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%