This commit is contained in:
astaxie
2013-07-16 19:05:44 +08:00
parent 60200689f4
commit 7f4ad7ff46
5 changed files with 111 additions and 0 deletions

15
cache/cache_test.go vendored
View File

@@ -31,6 +31,21 @@ func Test_cache(t *testing.T) {
t.Error("set Error", err)
}
if err = bm.Incr("astaxie"); err != nil {
t.Error("Incr Error", err)
}
if v := bm.Get("astaxie"); v.(int) != 2 {
t.Error("get err")
}
if err = bm.Decr("astaxie"); err != nil {
t.Error("Incr Error", err)
}
if v := bm.Get("astaxie"); v.(int) != 1 {
t.Error("get err")
}
bm.Delete("astaxie")
if bm.IsExist("astaxie") {
t.Error("delete err")