souplesse/tests/UnitTest.hs

23 lines
488 B
Haskell

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