|
@@ -257,7 +257,7 @@ func TestSessionDestroy(t *testing.T) {
|
|
sess := New(w, r, "./../tmp")
|
|
sess := New(w, r, "./../tmp")
|
|
defer sess.Close()
|
|
defer sess.Close()
|
|
if r.URL.Path == "/set" {
|
|
if r.URL.Path == "/set" {
|
|
- sess.SetBool("some_bool", true)
|
|
|
|
|
|
+ sess.SetInt("some_var", 1)
|
|
w.Write([]byte(`ok`))
|
|
w.Write([]byte(`ok`))
|
|
} else {
|
|
} else {
|
|
w.WriteHeader(http.StatusNotFound)
|
|
w.WriteHeader(http.StatusNotFound)
|
|
@@ -288,13 +288,13 @@ func TestSessionDestroy(t *testing.T) {
|
|
sess := New(w, r, "./../tmp")
|
|
sess := New(w, r, "./../tmp")
|
|
defer sess.Close()
|
|
defer sess.Close()
|
|
if r.URL.Path == "/get" {
|
|
if r.URL.Path == "/get" {
|
|
- w.Write([]byte(fmt.Sprintf("%v", sess.GetBool("some_bool", false))))
|
|
|
|
|
|
+ w.Write([]byte(fmt.Sprintf("%v", sess.GetInt("some_var", 0))))
|
|
} else {
|
|
} else {
|
|
w.WriteHeader(http.StatusNotFound)
|
|
w.WriteHeader(http.StatusNotFound)
|
|
w.Write([]byte(`404`))
|
|
w.Write([]byte(`404`))
|
|
}
|
|
}
|
|
}).ServeHTTP(recorder, request)
|
|
}).ServeHTTP(recorder, request)
|
|
- if recorder.Body.String() != "true" {
|
|
|
|
|
|
+ if recorder.Body.String() != "1" {
|
|
t.Fatalf("bad body response, not match")
|
|
t.Fatalf("bad body response, not match")
|
|
}
|
|
}
|
|
|
|
|
|
@@ -309,6 +309,7 @@ func TestSessionDestroy(t *testing.T) {
|
|
sess := New(w, r, "./../tmp")
|
|
sess := New(w, r, "./../tmp")
|
|
defer sess.Close()
|
|
defer sess.Close()
|
|
if r.URL.Path == "/get" {
|
|
if r.URL.Path == "/get" {
|
|
|
|
+ sess.SetInt("some_var", 2)
|
|
err := sess.Destroy()
|
|
err := sess.Destroy()
|
|
if err == nil {
|
|
if err == nil {
|
|
w.Write([]byte(`OK`))
|
|
w.Write([]byte(`OK`))
|