Commit b04bfa99 authored by simonmar's avatar simonmar
Browse files

[project @ 2002-06-03 11:12:52 by simonmar]

Add test for hGetLine on file without a final '\n'.
parent 863ad0ba
......@@ -13,6 +13,7 @@ test "hGetBuffering001" { $stdin = "hGetBuffering001.hs"
test "hGetChar001" { vtr("","","") }
test "hGetLine001" { $stdin = "hGetLine001.hs"
vtr("-cpp","","") }
test "hGetLine002" { vtr("","","") }
test "hGetPosn001" { vtr("-cpp","","") }
test "hIsEOF001" { vtr("","","") }
test "hIsEOF002" { vtr("-cpp","","") }
......
-- !!! testing hGetLine on a file without a final '\n'.
-- According to the Haskell 98 report, getLine should discard a line without a
-- closing newline character (see implementation of getLine).
--
-- However, we don't believe that this is the right behaviour.
import IO
main = catch loop (\e -> print e)
loop = do
l <- hGetLine stdin
putStrLn l
loop
this line doesn't end with a newline
\ No newline at end of file
this line doesn't end with a newline
end of file
Action: hGetLine
Handle: {loc=<stdin>,type=readable,binary=False,buffering=block (8192)}
File: <stdin>
Markdown is supported
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