Skip to content

Commit 386ea91

Browse files
committed
Fix store/store_test.go
1 parent 9873ef6 commit 386ea91

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

store/store_test.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"strconv"
99
"testing"
1010
"time"
11+
1112
"code.google.com/p/gogoprotobuf/proto"
1213

1314
"github.com/boltdb/bolt"
@@ -193,15 +194,15 @@ func TestStore_Save(t *testing.T) {
193194
session.Values = make(map[interface{}]interface{})
194195
session.Values[make(chan int)] = make(chan int)
195196
if err := str.Save(req, w, session); err == nil || err.Error() != "gob: type not registered for interface: chan int" {
196-
t.Error(`str.Save should return an error "%s" (actual: %+v)`, "gob: type not registered for interface: chan int", err)
197+
t.Errorf(`str.Save should return an error "%s" (actual: %+v)`, "gob: type not registered for interface: chan int", err)
197198
}
198199

199200
// When session.Options.MaxAge >= 0 and
200201
// securecookie.EncodeMulti returns an error
201202
session.Values = make(map[interface{}]interface{})
202203
str.codecs = nil
203204
if err := str.Save(req, w, session); err == nil || err.Error() != "securecookie: no codecs provided" {
204-
t.Error(`str.Save should return an error "%s" (actual: %+v)`, "securecookie: no codecs provided", err)
205+
t.Errorf(`str.Save should return an error "%s" (actual: %+v)`, "securecookie: no codecs provided", err)
205206
}
206207
}
207208

@@ -265,8 +266,8 @@ func TestStore_load(t *testing.T) {
265266
t.Error(err)
266267
}
267268
_, err = str.load(session)
268-
if err == nil || err.Error() != "proto: field/encoding mismatch: wrong type for field" {
269-
t.Error(`str.load should return an error "%s" (actual: %s)`, "proto: field/encoding mismatch: wrong type for field", err)
269+
if err == nil || err.Error() != "proto: protobuf.Session: wiretype end group for non-group" {
270+
t.Errorf(`str.load should return an error "%s" (actual: %s)`, "proto: protobuf.Session: wiretype end group for non-group", err)
270271
}
271272

272273
// When the target session data is expired

0 commit comments

Comments
 (0)