FAILURE MAP
← Case archive

FA-75567 / Text diff and three-way merge / Member archive

Character diff cleanup merge: the factored prefix becomes a separate equality · case 02

Two equalities sit next to each other after cleanup, so identical changes normalize differently.

Member previewVariant 2 · 3 implementations · 10 checks per implementation

Case contract

Normalize a character diff of [op, text] (op -1 delete, 0 equal, 1 insert): drop empty texts, merge adjacent equalities, collect each run of edits into one deletion and one insertion (deletion first), move their common prefix into the preceding equality (creating one at the start if needed) and their common suffix into the following equality (appending one at the end if needed).

Why this case matters

Character-level diff engines normalize raw edit scripts so that the same change always renders the same way.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
common prefix moves into the previous equality[[0, "x"], [0, "ab"], [-1, "c"], [1, "d"], [0, "y"]][[0, "xab"], [-1, "c"], [1, "d"], [0, "y"]]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗