Exclude Cabal PackageTests from gen_contents_index.
[ghc.git] / testsuite / tests / driver / T4114dSub.hs
1 module T4114dSub (assertKeep, assertNoKeep) where
2
3 import Control.Monad (unless, when)
4 import System.Directory (doesFileExist)
5
6 assertNoKeep :: FilePath -> IO ()
7 assertNoKeep a =
8 whenM (doesFileExist a) $
9 error ("error: intermediate '" ++ a ++ "' exists")
10
11 assertKeep :: FilePath -> IO ()
12 assertKeep a =
13 unlessM (doesFileExist a) $
14 error ("error: intermediate '" ++ a ++ "' is missing")
15
16 whenM :: Monad m => m Bool -> m () -> m ()
17 whenM mp f = mp >>= \p -> when p f
18
19 unlessM :: Monad m => m Bool -> m () -> m ()
20 unlessM mp f = mp >>= \p -> unless p f