Enrich test.assert-eq / test.assert failure output with actual vs expected values #422
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#422
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
When a Seq test fails today, the output reports only the failing test's name:
A failing test word typically has several
test.assert-eqcalls. From this output, the caller can't tell which assertion failed, what value was actually on the stack, or which line of source to look at.This is especially painful in Seqlings (https://github.com/navicore/seqlings), where the whole value proposition is "quick, educational feedback as you iterate." Right now a failure just tells the learner "something is off" — they retry blindly or fall back to the hint. Richer failure output would let the learner reason about their mistake directly.
Proposal
Have
test.assert-eqandtest.assertemit actual vs expected values (and a source line number when feasible) on failure. Approximate shape:For
test.assert(boolean), something like:Multiple failures within a single test word should each get a line. If multiple failures would overwhelm output, emitting just the first (with a "+N more failures" footer) is also fine.
Who benefits
assert_eq!(with its `left: ... right: ...` output), Go's `t.Errorf`, or Python's pytest provides.Implementation notes (non-prescriptive)
Downstream follow-up
Seqlings has a design note for how it would consume this: `docs/design/FAILED-ASSERTION-DETAILS.md`. Seqlings would pick up the richer output with no code change (it forwards `seqc test` stdout verbatim), and may add a complementary source-scanning bridge regardless.
https://github.com/navicore/patch-seq/pull/423