response: Add tests for maximum-length META

This commit is contained in:
Adnan Maolood 2021-02-27 14:08:31 -05:00
parent f156be19b4
commit 6a1ccdc644
1 changed files with 10 additions and 1 deletions

View File

@ -38,6 +38,15 @@ func TestReadWriteResponse(t *testing.T) {
Meta: "/redirect",
SkipWrite: true, // skip write test since result won't match Raw
},
{
Raw: "32 " + maxURL + "\r\n",
Status: 32,
Meta: maxURL,
},
{
Raw: "33 " + maxURL + "xxxx" + "\r\n",
Err: ErrInvalidResponse,
},
{
Raw: "99 Unknown status code\r\n",
Status: 99,
@ -87,7 +96,7 @@ func TestReadWriteResponse(t *testing.T) {
if err != test.Err {
t.Errorf("expected err = %v, got %v", test.Err, err)
}
if test.Err != nil {
if err != nil {
// No response
continue
}