X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2FcopyFile001.hs;h=e039becc778c992665dd53db31c886ede3abbd19;hb=e6e0fcd70d76aecbbbb73bebd1dd18ca6545d667;hp=e279dd0131ce5dc0621304c9d78d87742aea522f;hpb=1e5361634268e81dfa56c87e2c2f0342d4314e81;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"