X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2FcopyFile001.hs;h=e039becc778c992665dd53db31c886ede3abbd19;hb=7f45934b8c30342c42a76fd16738f146724cbfbb;hp=e279dd0131ce5dc0621304c9d78d87742aea522f;hpb=aa0d1fb69cdd1eb2f5e4ee2e073a097b1876aaaa;p=haskell-directory.git 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"