summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--http/client/client_test.go22
2 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5e81a4c..b4a5b41 100644
--- a/Makefile
+++ b/Makefile
@@ -9,3 +9,6 @@ peach: fmt
fmt:
go fmt ${MOD} ${MOD}/http/client
+test:
+ go test -v ${MOD}/http/client
+.PHONY: test
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
+ }
+}