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

Function Test_CookieJarHostStorageIsBounded

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

Source from the content-addressed store, hash-verified

195}
196
197func Test_CookieJarHostStorageIsBounded(t *testing.T) {
198 t.Parallel()
199
200 cj := &CookieJar{}
201
202 for i := range maxCookieJarHosts + 32 {
203 host := fmt.Sprintf("host-%d.example.com", i)
204 cookie := &fasthttp.Cookie{}
205 cookie.SetKey("k")
206 cookie.SetValue("v")
207 cj.SetByHost([]byte(host), cookie)
208 }
209
210 require.LessOrEqual(t, len(cj.hostCookies), maxCookieJarHosts)
211}
212
213func Test_CookieJarHostEvictionIsDeterministic(t *testing.T) {
214 t.Parallel()

Callers

nothing calls this directly

Calls 1

SetByHostMethod · 0.95

Tested by

no test coverage detected