From: Simon Marlow Date: Thu, 18 Oct 2007 12:14:05 +0000 (+0000) Subject: move copyFile001 from testsuite X-Git-Tag: 2008-05-28~10 X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=0113b6621138bc7f171c62cd30dd16ba59691dc3 move copyFile001 from testsuite --- 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"