diff --git a/README.md b/README.md index 238a54e3..9c59fa8d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ## beego -======= beego is a Go Framework which is inspired from tornado and sinatra. It is a simply & powerful web framework. diff --git a/session/sess_test.go b/session/sess_test.go new file mode 100644 index 00000000..b7d0b38c --- /dev/null +++ b/session/sess_test.go @@ -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") + } +}