Skip to content

Commit

Permalink
add: map equal
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatDiscovery committed Feb 10, 2025
1 parent d71487d commit 01e8b67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/basic/collection/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ func (p person) string() string {
return fmt.Sprintf("name=%s, age=%v", p.Name, p.Age)
}

func TestMapEqual(t *testing.T) {
m1 := map[string]int{"a": 1, "b": 2}
m2 := map[string]int{"a": 1, "b": 2}
assert.Equal(t, m1, m2)
m3 := map[string]int{"a": 1, "b": 3}
assert.Equal(t, m1, m3)
}

func TestMapPointer(t *testing.T) {
m := make(map[string]*person)
if v, ok := m["k1"]; ok {
Expand Down

0 comments on commit 01e8b67

Please sign in to comment.