Fix hSetBuffering004 to work with dynamic ghci
authorIan Lynagh <ian@well-typed.com>
Sun, 16 Jun 2013 19:23:49 +0000 (20:23 +0100)
committerIan Lynagh <ian@well-typed.com>
Sun, 16 Jun 2013 19:23:49 +0000 (20:23 +0100)
We need to actually consume the rest of stdin, or ghci will try
to interpret it as commands.

tests/IO/hSetBuffering004.hs
tests/IO/hSetBuffering004.stdout

index eaee682..01b9aae 100644 (file)
@@ -7,3 +7,4 @@ main :: IO ()
 main = do hSetBuffering stdin NoBuffering
           hLookAhead stdin >>= print
           hSetBuffering stdin LineBuffering
+          getContents >>= print
index 7766eec..a7c3946 100644 (file)
@@ -1 +1,2 @@
 '-'
+"-- test for #2678\nmodule Main (main) where\n\nimport System.IO\n\nmain :: IO ()\nmain = do hSetBuffering stdin NoBuffering\n          hLookAhead stdin >>= print\n          hSetBuffering stdin LineBuffering\n          getContents >>= print\n"