Skip to content

Commit

Permalink
Adds a unit test for filenamePrefix function
Browse files Browse the repository at this point in the history
  • Loading branch information
asnodgrass committed May 15, 2017
1 parent 2e6fec6 commit 246300e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/gpx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 246300e

Please sign in to comment.