Per ADR-0045 (three-tier library naming) the launcher-test migrates
from the retired lib-sporel.* prefix to the new lib-management.* tier.
- manifest.lib id: lib-sporel.launcher-test -> lib-management.launcher-test
- manifest.core id: lib-sporel.launcher-test.core -> lib-management.launcher-test.core
- init.lua engine.module.dir_of("lib-management.launcher-test")
- README + fsm.lua + init.lua comments updated
Gitea repo renamed in lockstep:
sporel/sporel-lib-sporel.launcher-test ->
sporel/sporel-lib-management.launcher-test
50 lines
2.2 KiB
Markdown
50 lines
2.2 KiB
Markdown
# sporel-lib-management.launcher-test
|
|
|
|
P.3.4 reference test-module — validates `lib-management.launcher` FSM contracts
|
|
and engine-surface existence via the `engine.test.*` assertion surface.
|
|
|
|
- Module-ID: `lib-management.launcher-test`
|
|
- Version: `0.1.0`
|
|
- Kind: `test-module` (headless; runs init() once + exits)
|
|
- Note: Embeds its own byte-identical copy of `fsm.lua` (Sporel-resolver does
|
|
not resolve module-as-dep; drift guarded by smoke.sh P0-S15-pre hash check).
|
|
|
|
## Run
|
|
|
|
```bash
|
|
Sporel.exe --test-libs=lib-management.launcher-test
|
|
```
|
|
|
|
Output is TAP version 13 on stdout; exit-code = failure-count (0 = all pass).
|
|
|
|
## Coverage Statements (2026-05-16 Fault-Injection Audit)
|
|
|
|
Verified via deliberate-mutation in the launcher-test fixture's own `fsm.lua`
|
|
copy; mutations reverted after observation.
|
|
|
|
### Caught Mutations
|
|
|
|
| # | Mutation | Caught by |
|
|
|---|---|---|
|
|
| M1 | `STATE_LIST + "esc"` returns `STATE_LIST` instead of `STATE_QUIT_CONFIRM` | Assertion "list+esc -> quit_confirm" (ok 1) |
|
|
| M2 | `STATE_QUIT_CONFIRM + "enter"` returns `STATE_QUIT_CONFIRM` instead of `EXIT` | Assertion "quit_confirm+enter -> exit" (ok 3) |
|
|
|
|
### Uncaught Mutations (Gaps)
|
|
|
|
| # | Mutation | Why uncaught | Severity |
|
|
|---|---|---|---|
|
|
| M3 | Fallback `return state` removed (unknown state returns nil) | No test calls `fsm.next` with an unrecognized state string | Low |
|
|
|
|
**Resolution per Gap:**
|
|
- Gap M3: Cheap-fill applied — added assertion `fsm.next("garbage_state", "esc") == "garbage_state"` to verify unknown-state passthrough (commit see below).
|
|
|
|
### Cheap-Gap-Fills Applied
|
|
|
|
| Gap | New Assertion | Re-Inject Verifies |
|
|
|---|---|---|
|
|
| M3 | `unknown state passes through unchanged` — `fsm.next("garbage_state", "esc")` must equal `"garbage_state"` | ✓ |
|
|
|
|
### Tested Production-Lib Surface
|
|
|
|
`lib-management.launcher` v0.1.0 (FSM component) — Tests cover: all 5 explicit FSM transitions (`list+esc`, `quit_confirm+esc`, `quit_confirm+enter`, `quit_confirm+click_yes`, `quit_confirm+click_no`), stability for unhandled events (`list+click_module`), unknown-state passthrough, and engine-surface existence for `engine.module.list`, `engine.module.dir_of`, `engine.render.draw_text`, `engine.render.measure_text`.
|