(t *testing.T, cookies []*http.Cookie, prefix string)
| 2546 | } |
| 2547 | |
| 2548 | func mustFindCookie(t *testing.T, cookies []*http.Cookie, prefix string) *http.Cookie { |
| 2549 | t.Helper() |
| 2550 | for _, cookie := range cookies { |
| 2551 | t.Logf("testing cookie against prefix %q: %q", prefix, cookie.Name) |
| 2552 | if strings.HasPrefix(cookie.Name, prefix) { |
| 2553 | t.Logf("cookie %q found", cookie.Name) |
| 2554 | return cookie |
| 2555 | } |
| 2556 | } |
| 2557 | t.Fatalf("cookie with prefix %q not found", prefix) |
| 2558 | return nil |
| 2559 | } |