crosslang/octive-lean/corpus
Maximus Gorog 6592cd058d Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13'
git-subtree-dir: octive-lean
git-subtree-mainline: fd3d42ae33
git-subtree-split: 4b6fcec565
2026-05-12 02:59:14 -06:00
..
01_disp_string.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
01_disp_string.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
02_disp_integer.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
02_disp_integer.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
03_arithmetic.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
03_arithmetic.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
04_assignment.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
04_assignment.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
05_for_loop.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
05_for_loop.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
06_if_else.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
06_if_else.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
07_function_def.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
07_function_def.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
08_matrix_size.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
08_matrix_size.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
30_sym_basic.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
30_sym_basic.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
31_sym_solve_simplify.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
31_sym_solve_simplify.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
32_sym_calc.expected Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
32_sym_calc.m Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -06:00
README.md Add 'octive-lean/' from commit '4b6fcec565a170d7029d4ccba21be2ecd0512d13' 2026-05-12 02:59:14 -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.