Commit ef90a1d8 authored by Simon Marlow's avatar Simon Marlow
Browse files

add readwrite003 (from bug #679)

parent be63ee35
......@@ -91,6 +91,8 @@ test('readwrite002',
extra_clean(['readwrite002.inout'])],
compile_and_run, ['-cpp'])
test('readwrite003', extra_clean(['readwrite003.txt']), compile_and_run, [''])
test('hGetBuf001', compose(only_compiler_types(['ghc']),
compose(skip_if_fast,
expect_fail_if_windows)), compile_and_run, ['-package unix'])
......
import System.IO
file = "readwrite003.txt"
main = do
writeFile file "ab\ncd\nef\ngh"
h <- openFile file ReadWriteMode
hGetLine h
hPutStrLn h "yz"
hClose h
h <- openBinaryFile file ReadMode
hGetContents h >>= putStr
ab
yz
ef
gh
\ No newline at end of file
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