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