octive-lean/corpus
Maximus Gorog db79eb3fde
Some checks are pending
Lean Action CI / build (push) Waiting to run
Initial commit: Lean 4 reimplementation of GNU Octave
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 09:40:46 -06:00
..
01_disp_string.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
01_disp_string.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
02_disp_integer.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
02_disp_integer.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
03_arithmetic.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
03_arithmetic.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
04_assignment.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
04_assignment.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
05_for_loop.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
05_for_loop.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
06_if_else.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
06_if_else.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
07_function_def.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
07_function_def.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
08_matrix_size.expected Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
08_matrix_size.m Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00
README.md Initial commit: Lean 4 reimplementation of GNU Octave 2026-04-29 09:40:46 -06:00

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

  1. Add a case. Create corpus/NN_short_name.m.
  2. Snapshot. Run lake exe corpus-check --update to capture actual stdout into a sibling .expected file.
  3. Verify. Hand-review the .expected content. Compare to real Octave or to the language spec. If it's wrong, fix the implementation, not the snapshot.
  4. Commit the .m and the verified .expected together.

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 DIR alternate corpus directory (default corpus)
  • --bin PATH alternate interpreter binary (default .lake/build/bin/octive-lean)
  • --update snapshot mode

Outcome legend

  • pass stdout matches .expected (trailing whitespace ignored)
  • FAIL ran cleanly, output diverged
  • ERROR exit code != 0; runtime or parse error from OctiveLean
  • miss no .expected file yet — run --update to 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.