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

Commit

Permalink
Merge pull request #1184 from hs0210/work
Browse files Browse the repository at this point in the history
test: add unit test case for func GetAsMap
  • Loading branch information
lowzj committed Jan 16, 2020
2 parents cbb4d50 + 42e81a9 commit 169ff3f
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 169ff3f

Please sign in to comment.