From d7f22191be61d5287fec0e32b8eeec3523310e69 Mon Sep 17 00:00:00 2001 From: Richard Lehane Date: Mon, 18 Feb 2019 20:36:40 +0100 Subject: [PATCH] go modules; fix test --- go.mod | 1 + msoleps_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..9c409ee --- /dev/null +++ b/go.mod @@ -0,0 +1 @@ +module github.com/richardlehane/msoleps diff --git a/msoleps_test.go b/msoleps_test.go index 808e809..c3614d5 100644 --- a/msoleps_test.go +++ b/msoleps_test.go @@ -16,7 +16,7 @@ func testFile(t *testing.T, path string) *Reader { defer file.Close() doc, err := NewFrom(file) if err != nil { - t.Errorf("Error opening file; Returns error: ", err) + t.Errorf("Error opening file; Returns error: %v", err) } return doc } @@ -24,7 +24,7 @@ func testFile(t *testing.T, path string) *Reader { func TestDocSum(t *testing.T) { doc := testFile(t, testDocSum) if len(doc.Property) != 12 { - t.Error("Expecting 12 properties, got %d", len(doc.Property)) + t.Errorf("Expecting 12 properties, got %d", len(doc.Property)) } if doc.Property[1].String() != "Australian Broadcasting Corporation" { t.Errorf("Expecting 'ABC' as second property, got %s", doc.Property[1]) @@ -34,7 +34,7 @@ func TestDocSum(t *testing.T) { func TestSum(t *testing.T) { doc := testFile(t, testSum) if len(doc.Property) != 17 { - t.Error("Expecting 17 properties, got %d", len(doc.Property)) + t.Errorf("Expecting 17 properties, got %d", len(doc.Property)) } if doc.Property[5].String() != "Normal" { t.Errorf("Expecting 'Normal' as sixth property, got %s", doc.Property[5]) @@ -44,7 +44,7 @@ func TestSum(t *testing.T) { func TestSum1(t *testing.T) { doc := testFile(t, testSum1) if len(doc.Property) != 3 { - t.Error("Expecting 3 properties, got %d", len(doc.Property)) + t.Errorf("Expecting 3 properties, got %d", len(doc.Property)) } if doc.Property[0].String() != "Mail" { t.Errorf("Expecting 'Mail' as first property, got %s", doc.Property[0])