From 0113b6621138bc7f171c62cd30dd16ba59691dc3 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 18 Oct 2007 12:14:05 +0000 Subject: [PATCH] move copyFile001 from testsuite --- tests/all.T | 2 ++ tests/copyFile/source | 1 + tests/copyFile001.hs | 23 +++++++++++++++++++++++ tests/copyFile001.stdout | 5 +++++ 4 files changed, 31 insertions(+) create mode 100644 tests/copyFile/source create mode 100644 tests/copyFile001.hs create mode 100644 tests/copyFile001.stdout diff --git a/tests/all.T b/tests/all.T index 526e9ad..1c34882 100644 --- a/tests/all.T +++ b/tests/all.T @@ -7,3 +7,5 @@ test('getDirContents001', omit_ways(['ghci']), compile_and_run, ['-fno-gen-manif # Depends on binary from previous run, which gets removed by the driver way=ghci test('getPermissions001', omit_ways(['ghci']), compile_and_run, ['-cpp']) + +test('copyFile001', normal, compile_and_run, ['']) diff --git a/tests/copyFile/source b/tests/copyFile/source new file mode 100644 index 0000000..1b44515 --- /dev/null +++ b/tests/copyFile/source @@ -0,0 +1 @@ +This is the data \ No newline at end of file diff --git a/tests/copyFile001.hs b/tests/copyFile001.hs new file mode 100644 index 0000000..219b01b --- /dev/null +++ b/tests/copyFile001.hs @@ -0,0 +1,23 @@ + +module Main (main) where + +import Control.Exception +import Data.List +import System.Directory +import System.IO + +main :: IO () +main = do try $ removeFile to + cs_before <- getDirectoryContents "copyFile" + putStrLn "Before:" + print $ sort cs_before + copyFile from to + cs_before <- getDirectoryContents "copyFile" + putStrLn "After:" + print $ sort cs_before + readFile to >>= print + +from, to :: FilePath +from = "copyFile/source" +to = "copyFile/target" + diff --git a/tests/copyFile001.stdout b/tests/copyFile001.stdout new file mode 100644 index 0000000..6b17d94 --- /dev/null +++ b/tests/copyFile001.stdout @@ -0,0 +1,5 @@ +Before: +[".","..","source"] +After: +[".","..","source","target"] +"This is the data" -- 1.7.10.4