summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/IO/ioeGetErrorString001.hs
blob: 5621136a551a8207bff319503c4c1ab5a774935f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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."