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

fix some tests on Windows

parent 0d6b8de3
Left countReaders001.txt: openFile: permission denied (Permission denied)
two writes (should fail)
Right {loc=openFile005.out1,type=writable,binary=False,buffering=block (512)}
Left openFile005.out1: openFile: permission denied (Permission denied)
write and an append (should fail)
Right {loc=openFile005.out1,type=writable (append),binary=False,buffering=block (512)}
Left openFile005.out1: openFile: permission denied (Permission denied)
read/write and a write (should fail)
Right {loc=openFile005.out1,type=writable,binary=False,buffering=block (512)}
Left openFile005.out1: openFile: permission denied (Permission denied)
read and a read/write (should fail)
Right {loc=openFile005.out1,type=read-writable,binary=False,buffering=block (512)}
Left openFile005.out1: openFile: permission denied (Permission denied)
write and a read (should fail)
Right {loc=openFile005.out1,type=readable,binary=False,buffering=block (512)}
Left openFile005.out1: openFile: permission denied (Permission denied)
two writes, different files (silly, but should succeed)
two reads, should succeed
Left openFile007.out: openFile: permission denied (Permission denied)
hello, world
Left readFile001.out: openFile: permission denied (Permission denied)
-- !!! readFile test
import IO
source = "readFile001.hs"
filename = "readFile001.out"
main = do
s <- readFile source
h <- openFile filename WriteMode
hPutStrLn h s
hClose h
s <- readFile filename
-- This open should fail, because the readFile hasn't been forced
-- and the file is therefore still locked.
try (openFile filename WriteMode) >>= print
putStrLn s
-- should be able to open it for writing now, because we've forced the
-- whole file.
h <- openFile filename WriteMode
print h
{handle: readFile001.out}
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