e7e8f71409b3db444cd47725e3f00c233bb6a390
[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   hSetBinaryMode h True
9   hSeek h SeekFromEnd 0
10   (hGetChar h >> return ()) `catch`
11         \e -> if isEOFError e && fromJust (ioeGetHandle e) == h
12                 then putStrLn "ok."
13                 else putStrLn "failed."