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