[project @ 2001-05-21 15:25:24 by simonmar]
[ghc-hetmet.git] / ghc / tests / lib / System / system001.stdout
1 -- Not run on mingw, because of /dev/null use
2
3 import System (system, ExitCode(..), exitWith)
4
5 main = 
6     system "cat dog 1>/dev/null 2>&1" >>= \ ec ->
7     case ec of
8         ExitSuccess   -> putStr "What?!?\n" >> ioError (userError "dog succeeded")
9         ExitFailure _ ->
10             system "cat system001.hs 2>/dev/null" >>= \ ec ->
11             case ec of
12                 ExitSuccess   -> exitWith ExitSuccess
13                 ExitFailure _ -> putStr "What?!?\n" >> ioError (userError "cat failed")