X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2FcopyFile001.hs;h=e039becc778c992665dd53db31c886ede3abbd19;hb=e6e0fcd70d76aecbbbb73bebd1dd18ca6545d667;hp=219b01b4b8dc63aec97a76bb8f4bc3468669eb0b;hpb=0113b6621138bc7f171c62cd30dd16ba59691dc3;p=haskell-directory.git diff --git a/tests/copyFile001.hs b/tests/copyFile001.hs index 219b01b..e039bec 100644 --- a/tests/copyFile001.hs +++ b/tests/copyFile001.hs @@ -7,7 +7,7 @@ import System.Directory import System.IO main :: IO () -main = do try $ removeFile to +main = do tryIO $ removeFile to cs_before <- getDirectoryContents "copyFile" putStrLn "Before:" print $ sort cs_before @@ -17,6 +17,9 @@ main = do try $ 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"