Expand description
Patch application for round-trip testing.
Given a HunkIndex produced by [compute_two_way(a, b)]
and the original ropes a + b, apply_two_way applies
the hunks to a to produce a result equivalent to b.
This is the primitive that drives the property test
apply(diff(a, b), a) == b for randomly-generated rope
pairs.
Not the public surface for editing — production hunk
transfer (do / dp) lands in D.5 and routes through the
standard edit pipeline rather than this helper.
Functions§
- apply_
two_ way - Apply a two-way
HunkIndexproduced bycompute_two_way(a, b)toa, reading replacement content fromb. The result equalsb(this is the round-trip invariant the property tests assert).