Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
test: add unit test case for func GetAsInt
Browse files Browse the repository at this point in the history
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
  • Loading branch information
hs0210 committed Jan 10, 2020
1 parent 7845c18 commit 2fe7047
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/syncmap/syncmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ func (suite *SyncMapUtilSuite) TestRemove(c *check.C) {
sort.Strings(result)
c.Check(result, check.DeepEquals, []string{"aaa", "bbb"})
}

func (suite *SyncMapUtilSuite) TestGetAsInt(c *check.C) {
mmap := NewSyncMap()
mmap.Add("aaa", 111)

result, _ := mmap.GetAsInt("aaa")
c.Check(result, check.DeepEquals, 111)
}

0 comments on commit 2fe7047

Please sign in to comment.