aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/T1185.hs
diff options
context:
space:
mode:
authorGravatar Ian Lynagh <ian@well-typed.com>2013-01-25 01:29:44 +0000
committerGravatar Ian Lynagh <ian@well-typed.com>2013-01-25 01:29:44 +0000
commit67c5131fb6c03cc4ec4a378b0f124bdeec71ed93 (patch)
tree2218b87512700a6ebe009e9ea09c881d9a054cae /tests/T1185.hs
parent4b0731773035165026728feaddbc489dbb18b0f0 (diff)
Rename tests to not start with a digit
Diffstat (limited to 'tests/T1185.hs')
-rw-r--r--tests/T1185.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/T1185.hs b/tests/T1185.hs
new file mode 100644
index 0000000..4948417
--- /dev/null
+++ b/tests/T1185.hs
@@ -0,0 +1,24 @@
+module Main where
+
+import Control.Concurrent
+import System.Posix
+import System.IO
+import System.Exit
+
+main =
+ do putStrLn "running..."
+ (stdinr, stdinw) <- createPipe
+ (stdoutr, stdoutw) <- createPipe
+ pid <- forkProcess $ do hw <- fdToHandle stdoutw
+ hr <- fdToHandle stdinr
+ closeFd stdinw
+ hGetContents hr >>= hPutStr hw
+ hClose hr
+ hClose hw
+ exitImmediately ExitSuccess
+ threadDelay 100000
+ closeFd stdoutw
+ closeFd stdinw
+ hr2 <- fdToHandle stdoutr
+ hGetContents hr2 >>= putStr
+ getProcessStatus True False pid >>= print