From: Simon Marlow Date: Sat, 27 Sep 2008 13:31:11 +0000 (+0000) Subject: Fix these tests X-Git-Tag: 2009-06-25~29 X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=7f45934b8c30342c42a76fd16738f146724cbfbb;hp=aa0d1fb69cdd1eb2f5e4ee2e073a097b1876aaaa Fix these tests --- diff --git a/tests/copyFile001.hs b/tests/copyFile001.hs index e279dd0..e039bec 100644 --- a/tests/copyFile001.hs +++ b/tests/copyFile001.hs @@ -7,7 +7,7 @@ import System.Directory import System.IO main :: IO () -main = do ignoreExceptions $ removeFile to +main = do tryIO $ removeFile to cs_before <- getDirectoryContents "copyFile" putStrLn "Before:" print $ sort cs_before @@ -17,6 +17,9 @@ main = do ignoreExceptions $ removeFile to print $ sort cs_before readFile to >>= print +tryIO :: IO a -> IO (Either IOException a) +tryIO = try + from, to :: FilePath from = "copyFile/source" to = "copyFile/target" diff --git a/tests/copyFile002.hs b/tests/copyFile002.hs index ff42d67..222192b 100644 --- a/tests/copyFile002.hs +++ b/tests/copyFile002.hs @@ -12,7 +12,7 @@ main :: IO () main = do d <- getCurrentDirectory flip finally (setCurrentDirectory d) $ do setCurrentDirectory "copyFile" - ignoreExceptions $ removeFile to + tryIO $ removeFile to cs_before <- getDirectoryContents "." putStrLn "Before:" print $ sort cs_before @@ -22,6 +22,9 @@ main = do d <- getCurrentDirectory print $ sort cs_before readFile to >>= print +tryIO :: IO a -> IO (Either IOException a) +tryIO = try + from, to :: FilePath from = "source" to = "target" diff --git a/tests/createDirectory001.stdout b/tests/createDirectory001.stdout index d3a37b8..a4c46ee 100644 --- a/tests/createDirectory001.stdout +++ b/tests/createDirectory001.stdout @@ -1 +1 @@ -Left CreateDirectory: already exists (Cannot create a file when that file already exists.) +Left createDirectory001.dir: createDirectory: already exists (File exists) diff --git a/tests/createDirectory001.stdout-i386-unknown-mingw32 b/tests/createDirectory001.stdout-i386-unknown-mingw32 new file mode 100644 index 0000000..d3a37b8 --- /dev/null +++ b/tests/createDirectory001.stdout-i386-unknown-mingw32 @@ -0,0 +1 @@ +Left CreateDirectory: already exists (Cannot create a file when that file already exists.)