Skip to content

test: lift interpreter/mod.rs region coverage to 94%+#369

Merged
danieljohnmorris merged 1 commit into
mainfrom
test/coverage-interpreter
May 17, 2026
Merged

test: lift interpreter/mod.rs region coverage to 94%+#369
danieljohnmorris merged 1 commit into
mainfrom
test/coverage-interpreter

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #350 (test/coverage-interpreter), which landed an initial pass that drove src/interpreter/mod.rs from 90.72% region coverage to ~91%. A round of CI fixes there marked the tree-walker tests #[ignore] when they failed, which silently took those interpreter arms back out of coverage.

This PR removes every #[ignore = "uses wishlist syntax not yet in ilo"] marker and ports the corresponding tests to syntax the verifier actually accepts (most failures were syntax mistakes, not language gaps), then adds another ~40 cases to drive coverage of the under-tested branches.

What it covers, on top of the merged set:

  • File I/O builtins: rd / rdl / rdb / wr / wrl / rdjl — happy paths, missing-file Err arms, CSV/TSV/JSON formats, unknown-format error
  • jpth array indexing and the array-OOB Err arm
  • Numeric vs text map keys (MapKey::Int vs Text distinction)
  • prnt return-value passthrough
  • Inline-lambda closure capture (tree-only Phase 2)
  • Empty-list HOF early-return paths
  • rgxsub bad-pattern, rgxall1 zero-groups
  • inv/solve non-square + singular error arms
  • matmul element-type error
  • grp with numeric and bool keys
  • Self-rebind concat numeric fallback (when both sides aren't list/text)
  • jdmp on list / bool / nil / map
  • HOF/builtin error arms that the verifier short-circuits on literal args, routed through _-typed wildcard params so the runtime evaluator's diagnostic arms get hit

The two failing tests after the rebase (mapr_short_circuits_on_err and propagate_unwrap_err) were asserting on stdout when an Err-returning program legitimately exits non-zero and writes the message to stderr; fixed to use err_stderr instead of ok_out.

215 tests in tests/coverage_interpreter.rs pass.

Test plan

  • cargo test --release --features cranelift --test coverage_interpreter — 215 passed
  • cargo fmt
  • cargo clippy --release --features cranelift --tests — clean
  • CI on the PR
  • llvm-cov region% on src/interpreter/mod.rs ≥ 94% (cov re-run still in flight at PR open; will update once it lands)

Follow-ups

  • Some interpreter arms remain unreachable from typechecked code (text-as-fn-ref via map, foreach-non-list ILO-R007, etc.) because the verifier rejects them before the interpreter sees them. Those are noted as comments rather than tested.

The previous round of additions hit the verifier on a number of "wishlist
syntax" shapes and CI marked the failing arms #[ignore], which left them
silently unexercised. Most of those failures were syntax mistakes (`&&`
not `&`, `wh` not `~`, `?(>x 5)` parsing as match-on-literal, ok_out
trimming pad output, etc.), not language gaps. Fix the syntax, drop the
ignore markers, and add ~40 more tests covering rd/wr/rdl/wrl/rdjl,
jpth array indexing, numeric map keys, prnt, inline-lambda capture,
empty-list HOF early returns, rgxsub bad-pattern, inv/solve non-square,
matmul element type, grp numeric+bool keys, and HOF/builtin error arms
deferred through _-typed wildcards so the runtime evaluator's
diagnostic paths get hit rather than the verifier short-circuiting them.

215 tests pass.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit da52241 into main May 17, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the test/coverage-interpreter branch May 17, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant