diff options
Diffstat (limited to 'testsuite/tests/lib/IO/openTempFile001.hs')
-rw-r--r-- | testsuite/tests/lib/IO/openTempFile001.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/lib/IO/openTempFile001.hs b/testsuite/tests/lib/IO/openTempFile001.hs new file mode 100644 index 0000000000..36598e6d5b --- /dev/null +++ b/testsuite/tests/lib/IO/openTempFile001.hs @@ -0,0 +1,13 @@ +module Main where + +import System.IO +import Control.Exception +import System.Directory + +main = bracket + (openTempFile "." "test.txt") + (\(f,_) -> removeFile f) + (\(f,h) -> do hPutStrLn h $ "\xa9" -- Copyright symbol + hClose h + s <- readFile f + if (s /= "\xa9\n") then error ("failed: " ++ s) else return ()) |