souplesse/tests/UnitTest.hs

23 lines
488 B
Haskell
Raw Normal View History

2024-10-27 20:19:58 +00:00
module Main where
2024-10-27 23:13:39 +00:00
import qualified Track (Track, parse, length )
2024-10-27 20:19:58 +00:00
import Test.HUnit
import qualified System.Exit as Exit
2024-10-27 23:13:39 +00:00
2024-10-27 20:19:58 +00:00
test1 :: Test
2024-10-27 23:13:39 +00:00
test1 = TestCase $
let
trk = Track.parse "<gpx></gpx>"
in
assertEqual "empty track has no elements"
0 (Track.length trk)
2024-10-27 20:19:58 +00:00
tests :: Test
tests = TestList [TestLabel "test1" test1]
main :: IO ()
main = do
result <- runTestTT tests
if failures result > 0 then Exit.exitFailure else Exit.exitSuccess