summaryrefslogtreecommitdiffstats
path: root/http/client/client_test.go
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2022-04-24 00:06:02 -0400
committersiddharth <s@ricketyspace.net>2022-04-24 00:06:50 -0400
commitd49b4b029def8ff6d0dd9bd07a1d144516e1abbf (patch)
treed884facbdb840cb6ac7ead1bcea6ef71874d7d29 /http/client/client_test.go
parent6c777e540a9c15eea62407aa878be855a2e8e6e4 (diff)
http/client: add test for Get
Diffstat (limited to 'http/client/client_test.go')
-rw-r--r--http/client/client_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/http/client/client_test.go b/http/client/client_test.go
new file mode 100644
index 0000000..56a79c0
--- /dev/null
+++ b/http/client/client_test.go
@@ -0,0 +1,22 @@
+// Copyright © 2022 siddharth <s@ricketyspace.net>
+// SPDX-License-Identifier: ISC
+
+package client
+
+import (
+ "io"
+ "testing"
+)
+
+func TestGet(t *testing.T) {
+ res, err := Get("https://plan.cat/~s")
+ if err != nil {
+ t.Errorf("get failed: %v", err)
+ return
+ }
+ _, err = io.ReadAll(res.Body)
+ if err != nil {
+ t.Errorf("response read failed: %v", err)
+ return
+ }
+}