Add a test for the bug found in Handle printing yesterday.
io018_HC_OPTS += -fglasgow-exts -package lang
io022_HC_OPTS += -fglasgow-exts -package lang
io032_HC_OPTS += -fglasgow-exts -package lang
+io035_HC_OPTS += -package lang
io004_RUNTEST_OPTS += -x 42
io016_RUNTEST_OPTS += io016.hs io016.out
import CPUTime
main = do
+ t <- getCPUTime
+ print t
print (nfib 30)
t <- getCPUTime
+ print t
print (length (show t)) -- printing the CPU time itself is un-cool if you want to diff the output..
nfib :: Integer -> Integer
--- /dev/null
+
+-- test for a bug in GHC <= 4.08.2: handles were being left locked after
+-- being shown in an error message.
+main = do
+ getContents
+ catch getChar (\e -> print e >> return 'x')
+ catch getChar (\e -> print e >> return 'x')
--- /dev/null
+illegal operation
+Action: hGetChar
+Handle: {loc=stdin,type=semi-closed,buffering=block (8192)}
+
+Reason: handle is closed
+illegal operation
+Action: hGetChar
+Handle: {loc=stdin,type=semi-closed,buffering=block (8192)}
+
+Reason: handle is closed