git-subtree-dir: octive-lean git-subtree-mainline:fd3d42ae33git-subtree-split:4b6fcec565
1.5 KiB
1.5 KiB
Conformance Corpus
Each .m file is paired with an .expected file containing the expected stdout
when OctiveLean runs that source. The corpus is the data feed for both regression
testing and (later) for cross-checking against real Octave.
Workflow
- Add a case. Create
corpus/NN_short_name.m. - Snapshot. Run
lake exe corpus-check --updateto capture actual stdout into a sibling.expectedfile. - Verify. Hand-review the
.expectedcontent. Compare to real Octave or to the language spec. If it's wrong, fix the implementation, not the snapshot. - Commit the
.mand the verified.expectedtogether.
Running
lake build octive-lean # ensure the interpreter binary exists
lake exe corpus-check # run the full corpus (exit 0 iff all pass)
lake exe corpus-check --update # rewrite every .expected from current behavior
Flags:
--dir DIRalternate corpus directory (defaultcorpus)--bin PATHalternate interpreter binary (default.lake/build/bin/octive-lean)--updatesnapshot mode
Outcome legend
passstdout matches.expected(trailing whitespace ignored)FAILran cleanly, output divergedERRORexit code != 0; runtime or parse error from OctiveLeanmissno.expectedfile yet — run--updateto seed it
Philosophy
This is a snapshot test, not a unit test. --update is dangerous when used
without thought: it makes failing tests pass by rewriting the expectation. Always
review the diff manually before committing an updated snapshot.