Add 25 new W.2 assertions covering panel v0.3.0 features: - persistent flag auto-opens at register-time - z_tier render-order hud->normal->top - within-tier open-order preserved - input_block='none' passes through (no handler call) - input_block='self' hit-tests within bounds - input_block='all' swallows outside-clicks (modal block) - persistent + close() no-op when focused is persistent - close(id) explicit DOES close persistent - Loud-Error on unknown z_tier - Loud-Error on unknown input_block - default input_block per tier (hud=none, normal=self, top=all) - point_in_any_panel public API Total: 79 assertions pass. Manifest bumped to 0.3.0 + panel-dep to 0.3.0.
61 lines
2.4 KiB
Markdown
61 lines
2.4 KiB
Markdown
# lib-core.panel-test
|
|
|
|
Test-module for `lib-core.panel`. v0.3.0 expands to 79 assertions:
|
|
- v0.1.x: registry lifecycle, theme validation, error handling,
|
|
pause-gate, context-menu dispatch.
|
|
- v0.2.0 (W.0): multi-active model, 11 layout-slots, custom-fn layout,
|
|
hit-test reverse-open-order, bw-compat shim.
|
|
- v0.3.0 (W.2): z-tiers (hud/normal/top), persistent windows,
|
|
input_block routing (none/self/all), default-input_block per tier,
|
|
panel.point_in_any_panel public API.
|
|
|
|
**Version:** 0.3.0
|
|
**Lib-ID:** lib-core.panel-test
|
|
**Requires:** lib-core.panel v0.3.0
|
|
**Tags:** test, panel, ui, window-manager
|
|
|
|
## Running
|
|
|
|
```bash
|
|
export PATH="/c/msys64/mingw64/bin:$PATH"
|
|
cd ~/Projects/Sporel/sporel-engine
|
|
SPOREL_LIBS_DIR=~/Projects/Sporel/sporel-libs SPOREL_CI=1 SPOREL_LOG_STDERR=1 \
|
|
./build/Sporel.exe --test-libs=lib-core.panel-test 2>&1 | tail -15
|
|
```
|
|
|
|
Expected: `pass=79 fail=0`.
|
|
|
|
## Assertion Summary (v0.3.0)
|
|
|
|
**v0.1.x baseline (10 assertions):**
|
|
1. register + open / close round-trip
|
|
2. close after open works
|
|
3. toggle twice opens then closes
|
|
4. open with unknown widget_id raises an error
|
|
5. set_theme with valid override is visible via get_theme
|
|
6. set_theme with unknown key raises an error
|
|
7. register without render function raises an error
|
|
8. pause_on_open=true widget makes is_pausing() true; close makes it false
|
|
9. context-menu action callback invoked on click inside its row
|
|
10. non-pause widget: is_pausing() is false
|
|
|
|
**v0.2.0 W.0 multi-active + layout-slots (~44 assertions):** bw-compat
|
|
shim, multi-active open(A)+open(B), per-id close, focused-close,
|
|
layout-slot resolution (left-half, right-half, center, custom fn),
|
|
loud-error on unknown slot, hit-test reverse-open-order, is_pausing
|
|
across all open windows.
|
|
|
|
**v0.3.0 W.2 z-tiers + persistent + input-block (25 assertions):**
|
|
- persistent flag auto-opens at register-time + is in open_order
|
|
- z_tier render-order is hud → normal → top
|
|
- within z_tier, open-order preserved
|
|
- input_block="none" passes through (no handler call)
|
|
- input_block="self" hit-tests within bounds (inside vs outside)
|
|
- input_block="all" swallows outside-clicks (modal block)
|
|
- persistent + close() no-op when focused is persistent
|
|
- close(id) explicit DOES close persistent (modder-controlled)
|
|
- Loud-Error on unknown z_tier
|
|
- Loud-Error on unknown input_block
|
|
- default input_block per tier (hud=none, normal=self, top=all)
|
|
- point_in_any_panel public API (inside / outside / none open)
|