X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2FcopyFile002.hs;fp=tests%2FcopyFile002.hs;h=222192be2e768909fb0ffd0de40aac0a57360e1e;hb=7f45934b8c30342c42a76fd16738f146724cbfbb;hp=ff42d6721b1c482674524e2f5eae818e79c59a05;hpb=aa0d1fb69cdd1eb2f5e4ee2e073a097b1876aaaa;p=haskell-directory.git 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"