summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-03 16:57:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-03 16:57:07 -0400
commit97db2f945a4d1874e711defc3a855bb9ecada6c3 (patch)
tree32abce0ce688040a2e50c7a696b8ec8fee343ac7
parent146c36ca545a297f1e44e3cf2c91f3c0e17c909f (diff)
exception update in test too
-rw-r--r--test.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/test.hs b/test.hs
index 7b25917a1..245dd6706 100644
--- a/test.hs
+++ b/test.hs
@@ -11,10 +11,8 @@ import Test.QuickCheck
import System.Posix.Directory (changeWorkingDirectory)
import System.Posix.Files
-import Control.Exception (bracket_, bracket, throw)
-import System.IO.Error
import System.Posix.Env
-import qualified Control.Exception.Extensible as E
+import Control.Exception.Extensible
import qualified Data.Map as M
import System.IO.HVFS (SystemFS(..))
import Text.JSON
@@ -695,7 +693,7 @@ test_crypto = "git-annex crypto" ~: intmpclonerepo $ when Build.SysConfig.gpg $
git_annex :: String -> [String] -> IO Bool
git_annex command params = do
-- catch all errors, including normally fatal errors
- r <- E.try (run)::IO (Either E.SomeException ())
+ r <- try (run)::IO (Either SomeException ())
case r of
Right _ -> return True
Left _ -> return False
@@ -761,7 +759,7 @@ indir dir a = do
-- any type of error and change back to cwd before
-- rethrowing.
r <- bracket_ (changeToTmpDir dir) (changeWorkingDirectory cwd)
- (E.try (a)::IO (Either E.SomeException ()))
+ (try (a)::IO (Either SomeException ()))
case r of
Right () -> return ()
Left e -> throw e
@@ -832,14 +830,14 @@ checkunwritable f = do
checkwritable :: FilePath -> Assertion
checkwritable f = do
- r <- try $ writeFile f $ content f
+ r <- tryIO $ writeFile f $ content f
case r of
Left _ -> assertFailure $ "unable to modify " ++ f
Right _ -> return ()
checkdangling :: FilePath -> Assertion
checkdangling f = do
- r <- try $ readFile f
+ r <- tryIO $ readFile f
case r of
Left _ -> return () -- expected; dangling link
Right _ -> assertFailure $ f ++ " was not a dangling link as expected"