myers-diff
myers-diff copied to clipboard
Wrong results
Hi everyone interested.
Test case: call
Myers.diff('-aaha xxy 1','-aanv1 12',{'compare':'chars'})
It gives as a result 3 records of modifications:
- "ha" (2 chars) removed at position 3 in the left string, and "nv1" (3 chars) is added at position 3 in the right string, which is correct
- "xxy " (4 chars) are removed at position 6 in the left string and nothing is added at position 7 in the right string, which is correct
- nothing is removed at position 10 in the left string, and "2" is added at position 8 in the right string This means the resulting string ends with "21", not "12" which is incorrect. Position 10 is before the last "1" but this last modification takes place after it.