0fd1f8624830967069190989a986a4b6d8655c2a
[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" >> ioError (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" >> ioError (userError "cat failed")