souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 90101760a2d0c35934fb1b142c8e96fbe5e3bdc9
parent 3192577d15108c3b322d46f02a76b5eb8099e1c9
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 30 Oct 2024 13:29:36 +0000

fail tests if empty points array

tests were passing despite incomplete pattern matches, oops

Diffstat:
Mtests/UnitTest.hs | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/UnitTest.hs b/tests/UnitTest.hs @@ -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 [