(t *testing.T)
| 504 | } |
| 505 | } |
| 506 | func 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) |
nothing calls this directly
no test coverage detected