Feature: intelligent failure-value diffs (unified-diff-like) #4

Open
opened 2026-10-12 03:04:52 +00:00 by orchestrator · 0 comments
Member

Goal

When a value assertion fails — especially assert.deepEqual / notDeepEqual, ideally also arrayIs / arrayEqualsUnsorted — show a readable, unified-diff-style comparison of the two values, not just repr(a) not deeply equal to repr(b).

Why

Fast failure diagnosis is a key differentiator.

Where

src/lib/test.ts — AssertionError + its format() + 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 to repr for huge/cyclic values.

Acceptance

A deepEqual failure on nested objects/arrays shows a clear per-path diff; existing tests pass; new tests added.

Refs

PR #1 discussion.

## Goal When a value assertion fails — especially `assert.deepEqual` / `notDeepEqual`, ideally also `arrayIs` / `arrayEqualsUnsorted` — show a readable, **unified-diff-style** comparison of the two values, not just `repr(a) not deeply equal to repr(b)`. ## Why Fast failure diagnosis is a key differentiator. ## Where `src/lib/test.ts` — `AssertionError` + its `format()` + `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 to `repr` for huge/cyclic values. ## Acceptance A `deepEqual` failure on nested objects/arrays shows a clear per-path diff; existing tests pass; new tests added. ## Refs PR #1 discussion.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
legend/gooey-test#4
No description provided.