# sporel-module-lib-sporel.launcher-test P.3.4 reference test-module — validates `lib-sporel.launcher` FSM contracts and engine-surface existence via the `engine.test.*` assertion surface. - Module-ID: `lib-sporel.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-sporel.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-sporel.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`.