myers-diff icon indicating copy to clipboard operation
myers-diff copied to clipboard

Wrong results

Open andreyputilovmaterial opened this issue 1 year ago • 1 comments

Hi everyone interested. Test case: call Myers.diff('-aaha xxy 1','-aanv1 12',{'compare':'chars'}) It gives as a result 3 records of modifications:

  1. "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
  2. "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
  3. 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.

andreyputilovmaterial avatar Oct 27 '24 22:10 andreyputilovmaterial