From 637fc6a503c9f7c68dc667a07d15b4ecb825047d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 13 Mar 2009 21:13:57 +0000 Subject: [PATCH] Stop the copyFile00{1,2} tests tripping over each other --- tests/copyFile001.hs | 10 +++++----- tests/{copyFile => copyFile001dir}/source | 0 tests/copyFile002.hs | 4 ++-- tests/copyFile002dir/source | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) rename tests/{copyFile => copyFile001dir}/source (100%) create mode 100644 tests/copyFile002dir/source diff --git a/tests/copyFile001.hs b/tests/copyFile001.hs index e039bec..0a59af2 100644 --- a/tests/copyFile001.hs +++ b/tests/copyFile001.hs @@ -8,19 +8,19 @@ import System.IO main :: IO () main = do tryIO $ removeFile to - cs_before <- getDirectoryContents "copyFile" + cs_before <- getDirectoryContents "copyFile001dir" putStrLn "Before:" print $ sort cs_before copyFile from to - cs_before <- getDirectoryContents "copyFile" + cs_before <- getDirectoryContents "copyFile001dir" putStrLn "After:" print $ sort cs_before readFile to >>= print tryIO :: IO a -> IO (Either IOException a) -tryIO = try +tryIO = try from, to :: FilePath -from = "copyFile/source" -to = "copyFile/target" +from = "copyFile001dir/source" +to = "copyFile001dir/target" diff --git a/tests/copyFile/source b/tests/copyFile001dir/source similarity index 100% rename from tests/copyFile/source rename to tests/copyFile001dir/source diff --git a/tests/copyFile002.hs b/tests/copyFile002.hs index 222192b..66c79cd 100644 --- a/tests/copyFile002.hs +++ b/tests/copyFile002.hs @@ -11,7 +11,7 @@ import System.IO main :: IO () main = do d <- getCurrentDirectory flip finally (setCurrentDirectory d) $ do - setCurrentDirectory "copyFile" + setCurrentDirectory "copyFile002dir" tryIO $ removeFile to cs_before <- getDirectoryContents "." putStrLn "Before:" @@ -23,7 +23,7 @@ main = do d <- getCurrentDirectory readFile to >>= print tryIO :: IO a -> IO (Either IOException a) -tryIO = try +tryIO = try from, to :: FilePath from = "source" diff --git a/tests/copyFile002dir/source b/tests/copyFile002dir/source new file mode 100644 index 0000000..1b44515 --- /dev/null +++ b/tests/copyFile002dir/source @@ -0,0 +1 @@ +This is the data \ No newline at end of file -- 1.7.10.4