1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-09-28 15:21:23 +02:00

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

@ -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
}