Fix these tests
[haskell-directory.git] / tests / copyFile002.hs
index ff42d67..222192b 100644 (file)
@@ -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"