diff options
author | Paolo Capriotti <p.capriotti@gmail.com> | 2012-03-09 11:44:41 +0000 |
---|---|---|
committer | Paolo Capriotti <p.capriotti@gmail.com> | 2012-03-09 11:44:41 +0000 |
commit | 891c0bf89b89e3995d2dbc1f6f72b43312b14a44 (patch) | |
tree | 2f49d3817b718b226ca37489302bae735bf9ade0 /tests/libposix/posix003.hs | |
parent | 0e8de7869a0f3b32d2ac8cbe2aad74eb7dcf054a (diff) |
Copy tests from GHC testsuite (#1161)
Diffstat (limited to 'tests/libposix/posix003.hs')
-rw-r--r-- | tests/libposix/posix003.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/libposix/posix003.hs b/tests/libposix/posix003.hs new file mode 100644 index 0000000..b28f9f7 --- /dev/null +++ b/tests/libposix/posix003.hs @@ -0,0 +1,17 @@ + +import Control.Monad +import Data.Char +import System.Exit +import System.IO +import System.Process + +main = do hw <- openFile "po003.out" WriteMode + ph <- runProcess "pwd" [] (Just "/dev") Nothing Nothing (Just hw) Nothing + ec <- waitForProcess ph + hClose hw + unless (ec == ExitSuccess) $ error "pwd failed" + hr <- openFile "po003.out" ReadMode + output <- hGetContents hr + putStrLn ("Got: " ++ show (filter (not . isSpace) output)) + hClose hr + |