Skip to content

Commit

Permalink
Replacing []byte{} with nil in some test cases
Browse files Browse the repository at this point in the history
Issue: #1132
  • Loading branch information
uwaterloo gitlab committed Oct 24, 2021
1 parent f59a132 commit 0c70e19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions header_test.go
Expand Up @@ -61,13 +61,13 @@ func TestResponseHeaderMultiLineValue(t *testing.T) {
t.Errorf("parse protocol with non-default value failed, got: %s want: HTTP/3.3", header.Protocol())
}

if !bytes.Equal(header.AppendStatusLine([]byte{}), []byte("HTTP/3.3 200 SuperOK\r\n")) {
if !bytes.Equal(header.AppendStatusLine(nil), []byte("HTTP/3.3 200 SuperOK\r\n")) {
t.Errorf("parse status line with non-default value failed, got: %s want: HTTP/3.3 200 SuperOK", header.Protocol())
}

header.SetStatusMessage(nil)

if !bytes.Equal(header.AppendStatusLine([]byte{}), []byte("HTTP/3.3 200 OK\r\n")) {
if !bytes.Equal(header.AppendStatusLine(nil), []byte("HTTP/3.3 200 OK\r\n")) {
t.Errorf("parse status line with default protocol value failed, got: %s want: HTTP/3.3 200 OK", header.Protocol())
}

Expand Down Expand Up @@ -106,7 +106,7 @@ func TestResponseHeaderMultiLineName(t *testing.T) {
t.Errorf("expected default protocol, got: %s", header.Protocol())
}

if !bytes.Equal(header.AppendStatusLine([]byte{}), []byte("HTTP/1.1 200 OK\r\n")) {
if !bytes.Equal(header.AppendStatusLine(nil), []byte("HTTP/1.1 200 OK\r\n")) {
t.Errorf("parse status line with non-default value failed, got: %s want: HTTP/1.1 200 OK", header.Protocol())
}
}
Expand Down

0 comments on commit 0c70e19

Please sign in to comment.