FA-75587 / Text diff and three-way merge / Member archive
Character diff cleanup merge: a common suffix at the end of the text is lost · case 02
Characters shared by the final deletion and insertion disappear from the output.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| suffix at the end of the text | [[0, "st"], [-1, "xy"], [1, "uv"]] | [[0, "st"], [-1, "xy"], [1, "uv"], [0, "z2"]] | 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 ↗