IMPL5.md (911B)
1 # IMPL5: Eliminate non-exhaustive test pattern matches 2 3 ## Goal 4 Remove non-exhaustive pattern match warnings when running tests. 5 6 ## Steps 7 1) Identify the warning locations by grepping for partial pattern 8 matches in tests (e.g., `let Just`, `Right`, or direct field access). 9 2) Replace brittle matches with total helpers: 10 - Use small helper functions like `expectRight`/`expectJust` 11 that fail the test with an assertion message. 12 - Avoid `error` and unchecked indexing. 13 3) For repeated handshake setup, add a helper returning either 14 `Assertion` failure or the needed values, keeping each test 15 total and readable. 16 4) Ensure all tests handle the full set of constructors explicitly 17 (`Left`/`Right`, `Nothing`/`Just`, `FrameResult` variants). 18 5) Re-run `cabal test` to confirm warnings are gone. 19 20 ## Notes 21 - Keep helpers local to `test/Main.hs`. 22 - Preserve existing test coverage and intent.