|
|
@ -160,10 +160,9 @@ func TestMap(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
got := map[string]int{}
|
|
|
|
got := map[string]int{}
|
|
|
|
want := map[string]int{"one": 1, "two": 2, "three": 3}
|
|
|
|
want := map[string]int{"one": 1, "two": 2, "three": 3}
|
|
|
|
m.Range(func(k string, v int) bool {
|
|
|
|
for k, v := range m.All() {
|
|
|
|
got[k] = v
|
|
|
|
got[k] = v
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
if d := cmp.Diff(got, want); d != "" {
|
|
|
|
if d := cmp.Diff(got, want); d != "" {
|
|
|
|
t.Errorf("Range mismatch (-got +want):\n%s", d)
|
|
|
|
t.Errorf("Range mismatch (-got +want):\n%s", d)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -178,10 +177,9 @@ func TestMap(t *testing.T) {
|
|
|
|
m.Delete("noexist")
|
|
|
|
m.Delete("noexist")
|
|
|
|
got = map[string]int{}
|
|
|
|
got = map[string]int{}
|
|
|
|
want = map[string]int{}
|
|
|
|
want = map[string]int{}
|
|
|
|
m.Range(func(k string, v int) bool {
|
|
|
|
for k, v := range m.All() {
|
|
|
|
got[k] = v
|
|
|
|
got[k] = v
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
if d := cmp.Diff(got, want); d != "" {
|
|
|
|
if d := cmp.Diff(got, want); d != "" {
|
|
|
|
t.Errorf("Range mismatch (-got +want):\n%s", d)
|
|
|
|
t.Errorf("Range mismatch (-got +want):\n%s", d)
|
|
|
|
}
|
|
|
|
}
|
|
|
|