2b603bddbe9bc865190aef4a91d7310292f7a06d
[ghc-hetmet.git] / ghc / tests / io / should_run / io005.hs
1 import System (system, ExitCode(..), exitWith)
2
3 main = 
4     system "cat dog 1>/dev/null 2>&1" >>= \ ec ->
5     case ec of
6         ExitSuccess   -> putStr "What?!?\n" >> fail (userError "dog succeeded")
7         ExitFailure _ ->
8             system "cat io005.hs 2>/dev/null" >>= \ ec ->
9             case ec of
10                 ExitSuccess   -> exitWith ExitSuccess
11                 ExitFailure _ -> putStr "What?!?\n" >> fail (userError "cat failed")