(t *testing.T)
| 195 | } |
| 196 | |
| 197 | func 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 | |
| 213 | func Test_CookieJarHostEvictionIsDeterministic(t *testing.T) { |
| 214 | t.Parallel() |