X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2FcopyFile002.hs;h=66c79cd2f225a9853a7acf46d62da20268f1156f;hb=637fc6a503c9f7c68dc667a07d15b4ecb825047d;hp=ff42d6721b1c482674524e2f5eae818e79c59a05;hpb=1e5361634268e81dfa56c87e2c2f0342d4314e81;p=haskell-directory.git diff --git a/tests/copyFile002.hs b/tests/copyFile002.hs index ff42d67..66c79cd 100644 --- a/tests/copyFile002.hs +++ b/tests/copyFile002.hs @@ -11,8 +11,8 @@ import System.IO main :: IO () main = do d <- getCurrentDirectory flip finally (setCurrentDirectory d) $ do - setCurrentDirectory "copyFile" - ignoreExceptions $ removeFile to + setCurrentDirectory "copyFile002dir" + 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"