packages feed

pathtype-0.5.4.2: TestTemplate.hs

{-# LANGUAGE OverloadedStrings #-}
module TestModule (main) where

import System.Path
import System.Random (newStdGen, random)
import System.Exit (ExitCode, exitFailure)
import Control.Monad (when)
import Data.Char (toLower)

main :: IO ()
main = do
  g <- newStdGen
  let (a,_g') = random g
      -- TODO - integrate with QuickCheck
      x = rootDir </> "tmp" </> "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

results :: Char -> System.Path.FilePath ar -> [(String, Bool)]
results a x =
  <TESTS_GO_HERE>
  []