summaryrefslogtreecommitdiff
path: root/libraries/base/tests/IO/hReady001.hs
blob: bb7be1c78b55489699c02d2e16e6eb3161cb4980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
-- !!! hReady test

 -- hReady should throw and EOF exception at the end of a file. Trac #1063.

import System.IO
import System.IO.Error

main = do
 h <- openFile "hReady001.hs" ReadMode
 hReady h >>= print
 hSeek h SeekFromEnd 0
 (hReady h >> return ()) `catchIOError` print