Skip to content

Commit

Permalink
Add test for #6557 (#6558)
Browse files Browse the repository at this point in the history
## What changed?
I realized it's easy to make a test for #6557 without direct access to
compare m.contents.

## Why?
prevent regressions
  • Loading branch information
dnr authored Sep 25, 2024
1 parent c09c15c commit 97d0437
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/collection/sync_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,16 @@ func TestMap_PopAll(t *testing.T) {
m.Set(4, 4)
m.Pop(4)

mCopy := m

values = m.PopAll()
assert.Equal(t, 3, len(values))
sum := 0
for _, v := range values {
sum += v
}
assert.Equal(t, 6, sum)

_, ok := mCopy.Get(3)
assert.False(t, ok, "SyncMap is not correctly copyable")
}

0 comments on commit 97d0437

Please sign in to comment.