From b0835fc63877c63e88e75840c5d52d3167ad5e10 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 3 Dec 2021 07:19:28 -0700 Subject: initial commit --- archive_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 archive_test.go (limited to 'archive_test.go') diff --git a/archive_test.go b/archive_test.go new file mode 100644 index 0000000..7c4549e --- /dev/null +++ b/archive_test.go @@ -0,0 +1,24 @@ +package main + +import ( + "net/http" + "testing" +) + +func TestIsArchived(t *testing.T) { + + url := "http://example.com/" + archived, status := isArchived(url) + if archived != true || status != 200 { + t.Errorf("Received %t, %d: want %t, %d", archived, status, true, 200) + } +} + +func TestArchive200(t *testing.T) { + + url := "http://example.com/" + status := archive(url) + if status != http.StatusOK { + t.Errorf("Recieved %d; want %d", status, http.StatusOK) + } +} -- cgit v1.2.3-54-g00ecf