[project @ 2001-05-18 16:54:04 by simonmar]
[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."