diff options
Diffstat (limited to 'testsuite/tests/lib/IO/ioeGetHandle001.hs')
-rw-r--r-- | testsuite/tests/lib/IO/ioeGetHandle001.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/lib/IO/ioeGetHandle001.hs b/testsuite/tests/lib/IO/ioeGetHandle001.hs new file mode 100644 index 0000000000..a9ef58a8ca --- /dev/null +++ b/testsuite/tests/lib/IO/ioeGetHandle001.hs @@ -0,0 +1,13 @@ +-- !!! test ioeGetHandle + +import System.IO +import System.IO.Error +import Data.Maybe + +main = do + h <- openFile "ioeGetHandle001.hs" ReadMode + hSeek h SeekFromEnd 0 + (hGetChar h >> return ()) `catch` + \e -> if isEOFError e && fromJust (ioeGetHandle e) == h + then putStrLn "ok." + else putStrLn "failed." |