diff --git a/README.md b/README.md new file mode 100644 index 0000000..384e3f6 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# sporel-lib-core.camera-test + +P.3.5 test-lib — validates `lib-core.camera` v0.3.0 API contracts (state setters, +bounds-clamping, pan_enabled toggle, pan_invert, engine-surface presence) +via the `engine.test.*` assertion surface. 16 assertions total. + +- Lib-ID: `lib-core.camera-test` +- Version: `0.1.0` +- Kind: `test-lib` (headless; M.run_tests(ctx) invoked by engine test-runner) +- Spec: `meta/docs/superpowers/specs/2026-05-13-p3-5-camera-free-pan-design.md` + +## Run + +```bash +Sporel.exe --libs-dir= --test-libs=lib-core.camera-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 fixture-mirror; mutations reverted after observation. + +### Caught Mutations + +| # | Mutation | Caught by | +|---|---|---| +| M1 | `set_target`: x/y assignments swapped (`target_x = y; target_y = x`) | Assertions 1 ("set_target -> target", `t.x==100 and t.y==200`) and 4 ("set_target clamped to bounds") both fail | +| M2 | `clear_bounds` made no-op (`do return end` as first statement) | Assertion 5 ("clear_bounds -> unclamped") fails — target remains clamped after clear | +| M3 | `bind_pan_keys` auto-enable removed (`pan_enabled_v.keys = true` commented out) | Assertion 10 ("bind_pan_keys auto-enables") fails — `pan_enabled("keys")` returns false | + +### Uncaught Mutations (Gaps) + +None — all 3 mutations caught. + +### Tested Production-Lib Surface + +`lib-core.camera` v0.3.0 — Tests cover behavior of: `camera.set_target`/`target` (value + bounds-clamping), `camera.set_zoom`/`zoom`, `camera.set_pan_speed`/`pan_speed`, `camera.set_bounds`, `camera.clear_bounds`, `camera.bind_pan_keys` (auto-enable side-effect), `camera.set_pan_enabled`/`pan_enabled` (toggle false/true), `camera.set_pan_invert`/`pan_invert`. Engine surface: `engine.input.get_mouse_delta`, `engine.window.size` function presence.