Feature: intelligent failure-value diffs (unified-diff-like) #4
Loading…
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?
Goal
When a value assertion fails — especially
assert.deepEqual/notDeepEqual, ideally alsoarrayIs/arrayEqualsUnsorted— show a readable, unified-diff-style comparison of the two values, not justrepr(a) not deeply equal to repr(b).Why
Fast failure diagnosis is a key differentiator.
Where
src/lib/test.ts—AssertionError+ itsformat()+repr(); and the testrunner UI that renders failures (src/testrunner/*view.tsx).Approach
Structural diff for plain data (objects/arrays/primitives): show the differing paths with context,
diff -u-like; add line coloring in the UI. Cap size; fall back toreprfor huge/cyclic values.Acceptance
A
deepEqualfailure on nested objects/arrays shows a clear per-path diff; existing tests pass; new tests added.Refs
PR #1 discussion.