Skip to content

Commit ff694a8

Browse files
authored
Merge pull request sergi#44 from sergi/29-diff-equals-must-be-equal-to-originals
Test case to make sure that diff texts are equal to originals with checklines=true
2 parents f7fcaad + cf6d27e commit ff694a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

diffmatchpatch/dmp_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,10 @@ func Test_patch_make(t *testing.T) {
12701270
diffs = dmp2.DiffMain(text1, text2, true)
12711271
patches = dmp2.PatchMake(text1, diffs)
12721272
assert.Equal(t, "@@ -1,14 +1,16 @@\n Lorem \n+a \n ipsum do\n@@ -148,13 +148,12 @@\n m libero\n- \n vel.\n", dmp2.PatchToText(patches), "patch_make: Corner case of #28 wrong patch with timeout of 0")
1273+
1274+
// Additional check that the diff texts are equal to the originals even if we are using DiffMain with checklines=true #29
1275+
assert.Equal(t, text1, dmp2.DiffText1(diffs))
1276+
assert.Equal(t, text2, dmp2.DiffText2(diffs))
12731277
}
12741278

12751279
func Test_PatchSplitMax(t *testing.T) {

0 commit comments

Comments
 (0)