0d041e05917f3e1dc5b80899542858925d8585c5
[ghc-hetmet.git] / ghc / tests / lib / IO / ioeGetHandle001.hs
1 -- !!! test ioeGetHandle
2
3 import IO
4 import Maybe
5
6 main = do
7   h <- openFile "ioeGetHandle001.hs" ReadMode
8   hSeek h SeekFromEnd 0
9   (hGetChar h >> return ()) `catch`
10         \e -> if isEOFError e && fromJust (ioeGetHandle e) == h
11                 then putStrLn "ok."
12                 else putStrLn "failed."