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 GetAsMap
Browse files Browse the repository at this point in the history
Signed-off-by: Hu Shuai <[email protected]>
  • Loading branch information
hs0210 committed Jan 15, 2020
1 parent 72929df commit 42e81a9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/syncmap/syncmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,14 @@ func (suite *SyncMapUtilSuite) TestGetAsBool(c *check.C) {
result, _ := mmap.GetAsBool("aaa")
c.Check(result, check.DeepEquals, true)
}

func (suite *SyncMapUtilSuite) TestGetAsMap(c *check.C) {
expected := NewSyncMap()
expected.Add("expected", true)

mmap := NewSyncMap()
mmap.Add("aaa", expected)

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

0 comments on commit 42e81a9

Please sign in to comment.