avoid using isLeft/isRight which are not available with older ghc versions
This commit is contained in:
parent
6383d22ffa
commit
67b8e0b321
1 changed files with 2 additions and 3 deletions
5
Test.hs
5
Test.hs
|
@ -18,7 +18,6 @@ import Test.Tasty.Ingredients.Rerun
|
||||||
import Options.Applicative hiding (command)
|
import Options.Applicative hiding (command)
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import qualified Text.JSON
|
import qualified Text.JSON
|
||||||
import Data.Either
|
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
|
|
||||||
|
@ -1593,12 +1592,12 @@ checkregularfile f = do
|
||||||
|
|
||||||
checkdoesnotexist :: FilePath -> Assertion
|
checkdoesnotexist :: FilePath -> Assertion
|
||||||
checkdoesnotexist f =
|
checkdoesnotexist f =
|
||||||
(isLeft <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
|
(either (const True) (const False) <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
|
||||||
@? f ++ " exists unexpectedly"
|
@? f ++ " exists unexpectedly"
|
||||||
|
|
||||||
checkexists :: FilePath -> Assertion
|
checkexists :: FilePath -> Assertion
|
||||||
checkexists f =
|
checkexists f =
|
||||||
(isRight <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
|
(either (const False) (const True) <$> Utility.Exception.tryIO (getSymbolicLinkStatus f))
|
||||||
@? f ++ " does not exist"
|
@? f ++ " does not exist"
|
||||||
|
|
||||||
checkcontent :: FilePath -> Assertion
|
checkcontent :: FilePath -> Assertion
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue