Skip to content

Commit ffccea1

Browse files
committed
Merge pull request sergi#17 from torarvid/map-fix
Fix assertMapEqual so it compares Value.Interface()
2 parents a166935 + 765df25 commit ffccea1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

diffmatchpatch/dmp_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ func assertMapEqual(t *testing.T, seq1, seq2 interface{}) {
6060
}
6161

6262
for _, key1 := range keys1 {
63-
if a, b := v2.MapIndex(key1), v1.MapIndex(key1); a != b {
64-
t.Fatal("%v Different key/value in Map: %v != %v", caller(), a, b)
63+
if a, b := v2.MapIndex(key1).Interface(), v1.MapIndex(key1).Interface(); a != b {
64+
t.Fatalf("%v Different key/value in Map: %v != %v", caller(), a, b)
6565
}
6666
}
6767

6868
for _, key2 := range keys2 {
69-
if a, b := v1.MapIndex(key2), v2.MapIndex(key2); a != b {
70-
t.Fatal("%v Different key/value in Map: %v != %v", caller(), a, b)
69+
if a, b := v1.MapIndex(key2).Interface(), v2.MapIndex(key2).Interface(); a != b {
70+
t.Fatalf("%v Different key/value in Map: %v != %v", caller(), a, b)
7171
}
7272
}
7373
}

0 commit comments

Comments
 (0)