From: Ian Lynagh Date: Fri, 13 Mar 2009 21:13:57 +0000 (+0000) Subject: Stop the copyFile00{1,2} tests tripping over each other X-Git-Tag: 2009-06-25~10 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=637fc6a503c9f7c68dc667a07d15b4ecb825047d;p=haskell-directory.git Stop the copyFile00{1,2} tests tripping over each other --- 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