mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:30:56 +00:00
add session test & delete readme
This commit is contained in:
parent
d6dd84d535
commit
db525cba74
@ -1,5 +1,4 @@
|
|||||||
## beego
|
## beego
|
||||||
=======
|
|
||||||
beego is a Go Framework which is inspired from tornado and sinatra.
|
beego is a Go Framework which is inspired from tornado and sinatra.
|
||||||
|
|
||||||
It is a simply & powerful web framework.
|
It is a simply & powerful web framework.
|
||||||
|
28
session/sess_test.go
Normal file
28
session/sess_test.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package session
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_gob(t *testing.T) {
|
||||||
|
a := make(map[interface{}]interface{})
|
||||||
|
a["username"] = "astaxie"
|
||||||
|
a[12] = 234
|
||||||
|
b, err := encodeGob(a)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
c, err := decodeGob(b)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
if len(c) == 0 {
|
||||||
|
t.Error("decodeGob empty")
|
||||||
|
}
|
||||||
|
if c["username"] != "astaxie" {
|
||||||
|
t.Error("decode string error")
|
||||||
|
}
|
||||||
|
if c[12] != 234 {
|
||||||
|
t.Error("decode int error")
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user