Commit 2919d9a8 authored by Simon Marlow's avatar Simon Marlow
Browse files

add test for #4808

parent 014c745d
import System.IO
import GHC.IO.Handle
import GHC.IO.FD as FD
main = do
(fd, _) <- FD.openFile "4808.hs" ReadWriteMode
hdl <- mkDuplexHandle fd "4808.hs" Nothing nativeNewlineMode
hClose hdl
(fd2, _) <- FD.openFile "4808.hs" ReadWriteMode
print (fdFD fd == fdFD fd2) -- should be True
hGetLine hdl >>= print -- should fail with an exception
4808: 4808.hs: hGetLine: illegal operation (handle is closed)
......@@ -158,3 +158,5 @@ test('T4113', normal, compile_and_run, [''])
test('T4144', normal, compile_and_run, [''])
test('encodingerror001', normal, compile_and_run, [''])
test('4808', exit_code(1), compile_and_run, [''])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment