summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc002.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/conc002.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/conc002.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/conc002.hs b/testsuite/tests/concurrent/should_run/conc002.hs
new file mode 100644
index 0000000000..93efd6fe4c
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/conc002.hs
@@ -0,0 +1,14 @@
+module Main where
+
+import Control.Concurrent
+
+main = do
+ c <- newChan
+ let writer = writeList2Chan c "Hello World\n"
+ forkIO writer
+ let reader = do char <- readChan c
+ if (char == '\n')
+ then return ()
+ else do putChar char; reader
+ reader
+