move copyFile001 from testsuite
authorSimon Marlow <simonmar@microsoft.com>
Thu, 18 Oct 2007 12:14:05 +0000 (12:14 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 18 Oct 2007 12:14:05 +0000 (12:14 +0000)
tests/all.T
tests/copyFile/source [new file with mode: 0644]
tests/copyFile001.hs [new file with mode: 0644]
tests/copyFile001.stdout [new file with mode: 0644]

index 526e9ad..1c34882 100644 (file)
@@ -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 (file)
index 0000000..1b44515
--- /dev/null
@@ -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 (file)
index 0000000..219b01b
--- /dev/null
@@ -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 (file)
index 0000000..6b17d94
--- /dev/null
@@ -0,0 +1,5 @@
+Before:
+[".","..","source"]
+After:
+[".","..","source","target"]
+"This is the data"