|
8 | 8 | "strconv"
|
9 | 9 | "testing"
|
10 | 10 | "time"
|
| 11 | + |
11 | 12 | "code.google.com/p/gogoprotobuf/proto"
|
12 | 13 |
|
13 | 14 | "github.com/boltdb/bolt"
|
@@ -193,15 +194,15 @@ func TestStore_Save(t *testing.T) {
|
193 | 194 | session.Values = make(map[interface{}]interface{})
|
194 | 195 | session.Values[make(chan int)] = make(chan int)
|
195 | 196 | 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) |
197 | 198 | }
|
198 | 199 |
|
199 | 200 | // When session.Options.MaxAge >= 0 and
|
200 | 201 | // securecookie.EncodeMulti returns an error
|
201 | 202 | session.Values = make(map[interface{}]interface{})
|
202 | 203 | str.codecs = nil
|
203 | 204 | 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) |
205 | 206 | }
|
206 | 207 | }
|
207 | 208 |
|
@@ -265,8 +266,8 @@ func TestStore_load(t *testing.T) {
|
265 | 266 | t.Error(err)
|
266 | 267 | }
|
267 | 268 | _, 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) |
270 | 271 | }
|
271 | 272 |
|
272 | 273 | // When the target session data is expired
|
|
0 commit comments