1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-13 21:21:01 +00:00

add safemap and test

This commit is contained in:
astaxie
2013-03-28 15:25:49 +08:00
parent 1b715bcbea
commit f78ceb82d9
2 changed files with 82 additions and 0 deletions

24
safemap_test.go Normal file
View File

@ -0,0 +1,24 @@
package beego
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")
}
}