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 GetAsTime
Browse files Browse the repository at this point in the history
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
  • Loading branch information
Guangwen Feng committed Jan 20, 2020
1 parent 919ff03 commit 77f128e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/syncmap/syncmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package syncmap
import (
"sort"
"testing"
"time"

"github.com/go-check/check"
"github.com/willf/bitset"
Expand Down Expand Up @@ -121,3 +122,12 @@ func (suite *SyncMapUtilSuite) TestGetAsInt64(c *check.C) {
result, _ := mmap.GetAsInt64("aaa")
c.Check(result, check.DeepEquals, expected)
}

func (suite *SyncMapUtilSuite) TestGetAsTime(c *check.C) {
expected := time.Now()
mmap := NewSyncMap()
mmap.Add("aaa", expected)

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

0 comments on commit 77f128e

Please sign in to comment.