From 246300ebb86f165deb01edfe2398aef0d5f2e2b4 Mon Sep 17 00:00:00 2001 From: Adam Snodgrass Date: Mon, 15 May 2017 19:06:07 -0400 Subject: [PATCH] Adds a unit test for filenamePrefix function --- cmd/gpx_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/gpx_test.go b/cmd/gpx_test.go index 2729d33..e4a1ff3 100644 --- a/cmd/gpx_test.go +++ b/cmd/gpx_test.go @@ -140,3 +140,12 @@ func Test_maximumLongitude(t *testing.T) { t.Errorf("Expected %f, but got %f", expected, out) } } + +func Test_filenamePrefix(t *testing.T) { + expected := "foo.bar.baz" + t.Logf("Checking for valid filename prefix.. (expected: %s)", expected) + data := "/path/to/foo.bar.baz.gps" + if out := filenamePrefix(data); out != expected { + t.Errorf("Expected %s, but got %s", expected, out) + } +}