fail tests if empty points array
tests were passing despite incomplete pattern matches, oops
This commit is contained in:
parent
3192577d15
commit
90101760a2
@ -26,7 +26,7 @@ test1 = TestCase $
|
||||
testMalformed = TestCase $
|
||||
case Track.parse "<gpx><dgdsfg>></gpx>" of
|
||||
Left err -> assertBool "syntax error" True
|
||||
Right t -> assertFailure "no error message parsing bad xml"
|
||||
Right _ -> assertFailure "no error message parsing bad xml"
|
||||
|
||||
test2 = TestCase $
|
||||
case Track.parse onepoint
|
||||
@ -36,6 +36,7 @@ test2 = TestCase $
|
||||
assertEqual "matches lat/lon"
|
||||
(Track.Pos 51.0 (-0.1))
|
||||
(Track.pos p)
|
||||
Right [] -> assertFailure "no points"
|
||||
|
||||
test3 = TestCase $
|
||||
case Track.parse onepoint
|
||||
@ -44,6 +45,7 @@ test3 = TestCase $
|
||||
Right (p:ps) ->
|
||||
assertEqual "matches elevation"
|
||||
Nothing (Track.elevation p)
|
||||
Right [] -> assertFailure "no points"
|
||||
|
||||
test4 = TestCase $
|
||||
case Track.parse onepointEle
|
||||
@ -52,6 +54,7 @@ test4 = TestCase $
|
||||
Right (p:ps) ->
|
||||
assertEqual "matches elevation"
|
||||
(Just 25.2) (Track.elevation p)
|
||||
Right [] -> assertFailure "no points"
|
||||
|
||||
tests :: Test
|
||||
tests = TestList [
|
||||
|
Loading…
Reference in New Issue
Block a user