Skip to content

Commit

Permalink
Adjust set cookie test
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmundxia committed Sep 11, 2024
1 parent 439995e commit 306ebbe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1643,14 +1643,20 @@ func TestRequestHeaderSetCookie(t *testing.T) {
var h RequestHeader

h.Set("Cookie", "foo=bar; baz=aaa")
h.Set("cOOkie", "xx=yyy")

if string(h.Cookie("foo")) != "bar" {
t.Fatalf("Unexpected cookie %q. Expecting %q", h.Cookie("foo"), "bar")
}
if string(h.Cookie("baz")) != "aaa" {
t.Fatalf("Unexpected cookie %q. Expecting %q", h.Cookie("baz"), "aaa")
}

h.Set("cOOkie", "xx=yyy")
if string(h.Cookie("foo")) != "" {

Check failure on line 1654 in header_test.go

View workflow job for this annotation

GitHub Actions / lint

stringXbytes: suggestion: len(h.Cookie("foo")) != 0 (gocritic)
t.Fatalf("Unexpected cookie %q. Expecting %q", h.Cookie("foo"), "")
}
if string(h.Cookie("baz")) != "" {

Check failure on line 1657 in header_test.go

View workflow job for this annotation

GitHub Actions / lint

stringXbytes: suggestion: len(h.Cookie("baz")) != 0 (gocritic)
t.Fatalf("Unexpected cookie %q. Expecting %q", h.Cookie("baz"), "")
}
if string(h.Cookie("xx")) != "yyy" {
t.Fatalf("unexpected cookie %q. Expecting %q", h.Cookie("xx"), "yyy")
}
Expand Down

0 comments on commit 306ebbe

Please sign in to comment.