1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 02:20:19 +00:00

move safemap to utils & add many helpful slice function

This commit is contained in:
astaxie
2013-12-12 22:40:29 +08:00
parent 19119e99f7
commit b1374b6a08
3 changed files with 133 additions and 2 deletions

24
utils/safemap_test.go Normal file
View File

@ -0,0 +1,24 @@
package utils
import (
"testing"
)
func Test_beemap(t *testing.T) {
bm := NewBeeMap()
if !bm.Set("astaxie", 1) {
t.Error("set Error")
}
if !bm.Check("astaxie") {
t.Error("check err")
}
if v := bm.Get("astaxie"); v.(int) != 1 {
t.Error("get err")
}
bm.Delete("astaxie")
if bm.Check("astaxie") {
t.Error("delete err")
}
}