Skip to content

Commit f7f9a5c

Browse files
committed
Add the utf-8 test for DiffLevenshtein
1 parent dbf098b commit f7f9a5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

diffmatchpatch/diff_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,9 +1153,9 @@ func TestDiffLevenshtein(t *testing.T) {
11531153
dmp := New()
11541154

11551155
for i, tc := range []TestCase{
1156-
{"Levenshtein with trailing equality", []Diff{{DiffDelete, "abc"}, {DiffInsert, "1234"}, {DiffEqual, "xyz"}}, 4},
1157-
{"Levenshtein with leading equality", []Diff{{DiffEqual, "xyz"}, {DiffDelete, "abc"}, {DiffInsert, "1234"}}, 4},
1158-
{"Levenshtein with middle equality", []Diff{{DiffDelete, "abc"}, {DiffEqual, "xyz"}, {DiffInsert, "1234"}}, 7},
1156+
{"Levenshtein with trailing equality", []Diff{{DiffDelete, "абв"}, {DiffInsert, "1234"}, {DiffEqual, "эюя"}}, 4},
1157+
{"Levenshtein with leading equality", []Diff{{DiffEqual, "эюя"}, {DiffDelete, "абв"}, {DiffInsert, "1234"}}, 4},
1158+
{"Levenshtein with middle equality", []Diff{{DiffDelete, "абв"}, {DiffEqual, "эюя"}, {DiffInsert, "1234"}}, 7},
11591159
} {
11601160
actual := dmp.DiffLevenshtein(tc.Diffs)
11611161
assert.Equal(t, tc.Expected, actual, fmt.Sprintf("Test case #%d, %s", i, tc.Name))

0 commit comments

Comments
 (0)