diff options
Diffstat (limited to 'libgo/go/net/http/cookie_test.go')
-rw-r--r-- | libgo/go/net/http/cookie_test.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libgo/go/net/http/cookie_test.go b/libgo/go/net/http/cookie_test.go index 98dc2fade0d..d474f313476 100644 --- a/libgo/go/net/http/cookie_test.go +++ b/libgo/go/net/http/cookie_test.go @@ -52,6 +52,10 @@ var writeSetCookiesTests = []struct { &Cookie{Name: "cookie-8", Value: "eight", Domain: "::1"}, "cookie-8=eight", }, + { + &Cookie{Name: "cookie-9", Value: "expiring", Expires: time.Unix(1257894000, 0)}, + "cookie-9=expiring; Expires=Tue, 10 Nov 2009 23:00:00 GMT", + }, // The "special" cookies have values containing commas or spaces which // are disallowed by RFC 6265 but are common in the wild. { @@ -90,6 +94,18 @@ var writeSetCookiesTests = []struct { &Cookie{Name: "empty-value", Value: ""}, `empty-value=`, }, + { + nil, + ``, + }, + { + &Cookie{Name: ""}, + ``, + }, + { + &Cookie{Name: "\t"}, + ``, + }, } func TestWriteSetCookies(t *testing.T) { @@ -349,7 +365,7 @@ func TestSetCookieDoubleQuotes(t *testing.T) { {Name: "quoted3", Value: "both"}, } if len(got) != len(want) { - t.Fatal("got %d cookies, want %d", len(got), len(want)) + t.Fatalf("got %d cookies, want %d", len(got), len(want)) } for i, w := range want { g := got[i] |