Skip to content

Commit

Permalink
Test: Add a test of multi-value headers
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed Sep 9, 2020
1 parent c846003 commit d8f4918
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ func TestResponseWriter_Write_text(t *testing.T) {
t.Run(kind, func(t *testing.T) {
w := NewResponse()
w.Header().Set("Content-Type", kind)
w.Header().Set("Double-Header", "1")
w.Header().Add("double-header", "2")
w.Write([]byte("hello world\n"))

e := w.End()
assert.Equal(t, 200, e.StatusCode)
assert.Equal(t, "hello world\n", e.Body)
assert.Equal(t, kind, e.Headers["Content-Type"])
assert.Equal(t, []string{"1", "2"}, e.MultiValueHeaders["Double-Header"])
assert.False(t, e.IsBase64Encoded)
assert.True(t, <-w.CloseNotify())
})
Expand Down

0 comments on commit d8f4918

Please sign in to comment.