We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 367a9e1 commit 70aa3ceCopy full SHA for 70aa3ce
diff_test.go
@@ -139,6 +139,27 @@ func TestDiffRunes(t *testing.T) {
139
}
140
141
142
+func TestDiffStrings(t *testing.T) {
143
+ a := "brown fox jumps over the lazy dog"
144
+ b := "brwn faax junps ovver the lay dago"
145
+ res := diff.Strings(a, b)
146
+ echange := []diff.Change{
147
+ {2, 2, 1, 0},
148
+ {7, 6, 1, 2},
149
+ {12, 12, 1, 1},
150
+ {18, 18, 0, 1},
151
+ {27, 28, 1, 0},
152
+ {31, 31, 0, 2},
153
+ {32, 34, 1, 0},
154
+ }
155
+ for i, c := range res {
156
+ t.Log(c)
157
+ if c != echange[i] {
158
+ t.Error("expected", echange[i], "got", c)
159
160
161
+}
162
+
163
type ints struct{ a, b []int }
164
165
func (d *ints) Equal(i, j int) bool { return d.a[i] == d.b[j] }
0 commit comments