FAILURE MAP
← Case archive

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

Unified hunk builder: hunks whose contexts touch are split · case 05

Two nearby changes produce two hunks that repeat the same context lines.

Member previewVariant 5 · 3 implementations · 11 checks per implementation

Case contract

Given a full edit script ([tag, line], tags " ", "-", "+") and a context width C, group changes whose separating equal lines number at most 2C, extend each group by up to C lines on both sides, and emit a header "@@ -a,b +c,d @@" followed by the hunk lines. A range start is the 1-based first line, or the line before when the count is 0; a count of 1 is omitted.

Why this case matters

Unified diff output depends on hunk grouping, context trimming and the header conventions for empty and single-line ranges.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
two changes separated by exactly twice the context["@@ -1,6 +1,5 @@", "-a", " c0", " c1", " c2", " c3", " c4", "@@ -7,8 +6,9 @@", " c5", " c6", " c7", " c8", " c9", "+b", " c0", " c1", " c2"]["@@ -1,14 +1,14 @@", "-a", " c0", " c1", " c2", " c3", " c4", " c5", " c6", " c7", " c8", " c9", "+b", " c0", " c1", " c2"]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 ↗