From d49b4b029def8ff6d0dd9bd07a1d144516e1abbf Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 24 Apr 2022 00:06:02 -0400 Subject: http/client: add test for Get --- http/client/client_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 http/client/client_test.go (limited to 'http/client') 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 +// 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 + } +} -- cgit v1.2.3