[project @ 2001-05-18 16:54:04 by simonmar]
[ghc-hetmet.git] / ghc / tests / lib / IO / ioeGetErrorString001.hs
1 -- !!! test ioeGetErrorString
2
3 import IO
4 import Maybe
5
6 main = do
7   h <- openFile "ioeGetErrorString001.hs" ReadMode
8   hSeek h SeekFromEnd 0
9   (hGetChar h >> return ()) `catch`
10         \e -> if isEOFError e
11                 then print (ioeGetErrorString e)
12                 else putStrLn "failed."