diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-22 13:29:21 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-22 13:29:21 +0200 |
commit | 9f7463cd289e292a92d22b0cf9d63f500240d747 (patch) | |
tree | 74e3601aae8a310b58d1db8f0027bd6e0174f3f9 /cookie_test.go | |
parent | Access URI members via accessors (diff) | |
download | fasthttp-9f7463cd289e292a92d22b0cf9d63f500240d747.tar.gz fasthttp-9f7463cd289e292a92d22b0cf9d63f500240d747.tar.bz2 fasthttp-9f7463cd289e292a92d22b0cf9d63f500240d747.zip |
Access Cookie members via accessors
Diffstat (limited to 'cookie_test.go')
-rw-r--r-- | cookie_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cookie_test.go b/cookie_test.go index 478f91c..f1565e6 100644 --- a/cookie_test.go +++ b/cookie_test.go @@ -32,19 +32,19 @@ func TestCookieAppendBytes(t *testing.T) { testCookieAppendBytes(t, c, "foo", "", "foo=") testCookieAppendBytes(t, c, "ффф", "12 лодлы", "%D1%84%D1%84%D1%84=12%20%D0%BB%D0%BE%D0%B4%D0%BB%D1%8B") - c.Domain = []byte("foobar.com") + c.SetDomain("foobar.com") testCookieAppendBytes(t, c, "a", "b", "a=b; domain=foobar.com") - c.Path = []byte("/a/b") + c.SetPath("/a/b") testCookieAppendBytes(t, c, "aa", "bb", "aa=bb; domain=foobar.com; path=/a/b") - c.Expire = CookieExpireDelete + c.SetExpire(CookieExpireDelete) testCookieAppendBytes(t, c, "xxx", "yyy", "xxx=yyy; expires=Tue, 10 Nov 2009 23:00:00 GMT; domain=foobar.com; path=/a/b") } func testCookieAppendBytes(t *testing.T, c *Cookie, key, value, expectedS string) { - c.Key = []byte(key) - c.Value = []byte(value) + c.SetKey(key) + c.SetValue(value) result := string(c.AppendBytes(nil)) if result != expectedS { t.Fatalf("Unexpected cookie %q. Expected %q", result, expectedS) |