packages feed

pathtype-0.5.4.3: test/Test.hs

module Main (main) where

import TestResult (results)

import System.Path (rootDir, asRelDir, asRelFile, (</>), (<.>))
import System.Random (newStdGen, random)
import System.Exit (exitFailure)

main :: IO ()
main = do
  g <- newStdGen
  let (a,_g') = random g
      -- TODO - integrate with QuickCheck
      x = rootDir </> asRelDir "tmp" </> asRelFile "someFile" <.> "ext"

  let fails = map fst $ filter (not . snd) $ results a x

  if null fails
    then do
      putStrLn "Passed."
    else do
      putStrLn "Failed tests:"
      mapM_ putStrLn fails
      exitFailure