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:
24
utils/safemap_test.go
Normal file
24
utils/safemap_test.go
Normal 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")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user