MCPcopy Create free account
hub / github.com/BryanMwangi/pine / TestReadCookie

Function TestReadCookie

pine_test.go:506–522  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

504 }
505}
506func TestReadCookie(t *testing.T) {
507 ctx := &Ctx{Request: &http.Request{
508 Header: map[string][]string{
509 "Cookie": {"testCookie=testValue"},
510 },
511 }}
512
513 cookie, err := ctx.ReadCookie("testCookie")
514 if err != nil {
515 t.Fatal(err)
516 }
517
518 expected := "testValue"
519 if cookie.Value != expected {
520 t.Errorf("expected '%s', got '%s'", expected, cookie.Value)
521 }
522}
523
524// ---------------------------------------------------------------------------
525// SetCookie / DeleteCookie / SameSite tests (fixes 5 & 6)

Callers

nothing calls this directly

Calls 1

ReadCookieMethod · 0.95

Tested by

no test coverage detected