MCPcopy
hub / github.com/gofiber/fiber / Test_CookieJarGetExpired

Function Test_CookieJarGetExpired

client/cookiejar_test.go:102–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func Test_CookieJarGetExpired(t *testing.T) {
103 t.Parallel()
104
105 url1 := []byte("http://fasthttp.com/make/")
106 uri1 := fasthttp.AcquireURI()
107 require.NoError(t, uri1.Parse(nil, url1))
108
109 c1 := &fasthttp.Cookie{}
110 c1.SetKey("k")
111 c1.SetValue("v")
112 c1.SetExpire(time.Now().Add(-time.Hour))
113
114 cj := &CookieJar{}
115 cj.Set(uri1, c1)
116
117 cookies := cj.Get(uri1)
118 require.Empty(t, cookies)
119}
120
121func Test_CookieJarSet(t *testing.T) {
122 t.Parallel()

Callers

nothing calls this directly

Calls 5

SetMethod · 0.95
GetMethod · 0.95
ParseMethod · 0.65
AddMethod · 0.65
NowMethod · 0.45

Tested by

no test coverage detected