Compare commits
2 Commits
v0.2.0-rc.
...
v0.2.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbbef1fb6d | ||
|
|
90518a01a8 |
2
go.mod
2
go.mod
@@ -1,5 +1,5 @@
|
|||||||
module git.sr.ht/~adnano/go-gemini
|
module git.sr.ht/~adnano/go-gemini
|
||||||
|
|
||||||
go 1.16
|
go 1.15
|
||||||
|
|
||||||
require golang.org/x/net v0.0.0-20210119194325-5f4716e94777
|
require golang.org/x/net v0.0.0-20210119194325-5f4716e94777
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package gemini
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@@ -91,7 +92,7 @@ func TestReadWriteResponse(t *testing.T) {
|
|||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Logf("%#v", test.Raw)
|
t.Logf("%#v", test.Raw)
|
||||||
resp, err := ReadResponse(io.NopCloser(strings.NewReader(test.Raw)))
|
resp, err := ReadResponse(ioutil.NopCloser(strings.NewReader(test.Raw)))
|
||||||
if err != test.Err {
|
if err != test.Err {
|
||||||
t.Errorf("expected err = %v, got %v", test.Err, err)
|
t.Errorf("expected err = %v, got %v", test.Err, err)
|
||||||
}
|
}
|
||||||
@@ -105,7 +106,7 @@ func TestReadWriteResponse(t *testing.T) {
|
|||||||
if resp.Meta != test.Meta {
|
if resp.Meta != test.Meta {
|
||||||
t.Errorf("expected meta = %s, got %s", test.Meta, resp.Meta)
|
t.Errorf("expected meta = %s, got %s", test.Meta, resp.Meta)
|
||||||
}
|
}
|
||||||
b, _ := io.ReadAll(resp.Body)
|
b, _ := ioutil.ReadAll(resp.Body)
|
||||||
body := string(b)
|
body := string(b)
|
||||||
if body != test.Body {
|
if body != test.Body {
|
||||||
t.Errorf("expected body = %#v, got %#v", test.Body, body)
|
t.Errorf("expected body = %#v, got %#v", test.Body, body)
|
||||||
|
|||||||
Reference in New Issue
Block a user