test(reconcile): a span across a segment edge leaves neither segment holding a replaced word -- a mutation that skipped this survived
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -118,3 +118,13 @@ func TestReconcileSegments_SegmentsThatDoNotLineUpWithTheTextAreLeftAsTheBases(t
|
||||
assert.Equal(t, base.Segments, out.Segments)
|
||||
assert.Equal(t, "a y b c", out.Text, "the merged text is unaffected")
|
||||
}
|
||||
|
||||
func TestReconcileSegments_ASpanThatCrossesASegmentEdgeIsRemovedFromBothSegments(t *testing.T) {
|
||||
base := segmented("a b c d", domain.Segment{Start: 0, End: 5, Text: "a b"}, domain.Segment{Start: 5, End: 10, Text: "c d"})
|
||||
|
||||
out := merge(t, base, tr("a X d"), always(reconcile.VerdictAlt))
|
||||
|
||||
require.Equal(t, "a X d", out.Text)
|
||||
assert.Equal(t, "a X", out.Segments[0].Text)
|
||||
assert.Equal(t, "d", out.Segments[1].Text, "'c' was replaced too: it must not linger in the second segment")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user