MCPcopy Index your code
hub / github.com/coder/coder / mustFindCookie

Function mustFindCookie

coderd/workspaceapps/apptest/apptest.go:2548–2559  ·  view source on GitHub ↗
(t *testing.T, cookies []*http.Cookie, prefix string)

Source from the content-addressed store, hash-verified

2546}
2547
2548func 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}

Callers 1

RunFunction · 0.85

Calls 3

HelperMethod · 0.65
LogfMethod · 0.65
FatalfMethod · 0.45

Tested by

no test coverage detected