From 59b545e2306fed50b28e703faf9a6a93e3c42472 Mon Sep 17 00:00:00 2001 From: esell Date: Thu, 4 Apr 2019 09:10:38 -0600 Subject: [PATCH] add tests --- main_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 main_test.go diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..3875115 --- /dev/null +++ b/main_test.go @@ -0,0 +1,17 @@ +package main + +import "testing" + +func TestSubExists(t *testing.T) { + dummyRecords := make([]DomainRecord, 0) + + doesExist, recID := subExists(dummyRecords) + + if doesExist { + t.Errorf("subExists() returned true, should have been false") + } + + if recID != 0 { + t.Errorf("subExists() returned %v for recID, should be 0", recID) + } +}