4 Star 8 Fork 3

Lyric / cmap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
shard_map_test.go 529 Bytes
一键复制 编辑 原始数据 按行查看 历史
Lyric 提交于 2016-08-21 17:29 . First commit
package cmap_test
import (
"testing"
"github.com/LyricTian/cmap"
. "github.com/smartystreets/goconvey/convey"
)
func TestShardMap(t *testing.T) {
Convey("test all the shard map function", t, func() {
m := cmap.NewShardMap()
m.Set("foo", "bar")
m.Set("foo1", "bar1")
v, ok := m.Get("foo")
So(v, ShouldEqual, "bar")
So(ok, ShouldBeTrue)
So(m.Count(), ShouldEqual, 2)
So(m.Items(), ShouldContainKey, "foo")
m.Remove("foo")
So(m.Count(), ShouldEqual, 1)
m.Clear()
So(m.Count(), ShouldEqual, 0)
})
}
Go
1
https://gitee.com/lyric/cmap.git
git@gitee.com:lyric/cmap.git
lyric
cmap
cmap
master

搜索帮助