Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
test: add unit test case for func Remove
Browse files Browse the repository at this point in the history
Signed-off-by: Hu Shuai <[email protected]>
  • Loading branch information
hs0210 committed Jan 9, 2020
1 parent 7894da1 commit a021b8a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/syncmap/syncmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,16 @@ func (suite *SyncMapUtilSuite) TestListKeyAsIntSlice(c *check.C) {
sort.Ints(result)
c.Check(result, check.DeepEquals, []int{1, 2})
}

func (suite *SyncMapUtilSuite) TestRemove(c *check.C) {
mmap := NewSyncMap()
mmap.Add("aaa", true)
mmap.Add("bbb", true)
mmap.Add("ccc", true)

mmap.Remove("ccc")

result := mmap.ListKeyAsStringSlice()
sort.Strings(result)
c.Check(result, check.DeepEquals, []string{"aaa", "bbb"})
}

0 comments on commit a021b8a

Please sign in to comment.