summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-06 21:13:55 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-06 21:13:55 -0400
commit30e539c5283d9339775c3c7ae6bb3cad943dfaee (patch)
treef566a54b47507ec2ceac2fc6476956c9a6e4c0da /Test.hs
parent29bb75bd6b1a1a33761f161b7cfc177fea798e21 (diff)
avoid using isLeft/isRight which are not available with older ghc versions
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Test.hs b/Test.hs
index 8fe830cf9..20380ec5a 100644
--- a/Test.hs
+++ b/Test.hs
@@ -18,7 +18,6 @@ import Test.Tasty.Ingredients.Rerun
import Options.Applicative hiding (command)
import qualified Data.Map as M
import qualified Text.JSON
-import Data.Either
import Common
@@ -1593,12 +1592,12 @@ checkregularfile f = do
checkdoesnotexist :: FilePath -> Assertion
checkdoesnotexist f =
- (isLeft <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
+ (either (const True) (const False) <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
@? f ++ " exists unexpectedly"
checkexists :: FilePath -> Assertion
checkexists f =
- (isRight <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
+ (either (const False) (const True) <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
@? f ++ " does not exist"
checkcontent :: FilePath -> Assertion