From 03073b44eaa801afc2faad7175669c2ee377838d Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Fri, 25 Oct 2019 11:10:40 +0100 Subject: added test and some cleanup --- reader/reader_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'reader/reader_test.go') diff --git a/reader/reader_test.go b/reader/reader_test.go index ba3172e..a7dd281 100644 --- a/reader/reader_test.go +++ b/reader/reader_test.go @@ -22,3 +22,18 @@ func TestReadDML(t *testing.T) { t.Errorf("dmlData[0].Sheet = %s; want Introduction", dmlData[0].Key) } } + +func TestNoFileReturnsError(t *testing.T) { + _, err := ReadDML("/home/bobbins.csv") + // if we get no error, something has gone wrong + if err == nil { + t.Errorf("Should have thrown error %s", err) + } +} + +func TestBadDMLLine(t *testing.T) { + _, err := ReadDML("/home/lemon/code/python/bcompiler-engine/tests/resources/datamap_empty_cols.csv") + if err != nil { + t.Errorf("This will trigger") + } +} -- cgit v1.2.3