From 7ad0ec9474d6df6fa1a246856b31ad849809b5de Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 12 Jan 2018 18:50:59 +0100 Subject: Refactor to introduce Cabal version type --- tests/CompileTest.hs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/CompileTest.hs b/tests/CompileTest.hs index cc9c85a..89f79fa 100644 --- a/tests/CompileTest.hs +++ b/tests/CompileTest.hs @@ -129,21 +129,21 @@ main = do compilePrivatePkgDb :: Either HEAD Version -> IO (Either ExitCode FilePath) compilePrivatePkgDb eCabalVer = do - res <- E.try $ installCabal defaultOptions { verbose = True } eCabalVer + res <- E.try $ installCabal defaultOptions { oVerbose = True } eCabalVer case res of - Right (db, e_commit_ver) -> - compileWithPkg (Just db) e_commit_ver + Right (db, cabalVer) -> + compileWithPkg (Just db) cabalVer Left (ioe :: IOException) -> do print ioe return $ Left (ExitFailure 1) compileWithPkg :: Maybe PackageDbDir - -> Either String Version + -> CabalVersion -> IO (Either ExitCode FilePath) -compileWithPkg mdb eCabalVer = - compile "/does-not-exist" defaultOptions { verbose = True } $ - Compile Nothing mdb eCabalVer [cabalPkgId eCabalVer] +compileWithPkg mdb cabalVer = + compile "/does-not-exist" defaultOptions { oVerbose = True } $ + Compile Nothing mdb cabalVer [cabalPkgId cabalVer] -cabalPkgId :: Either String Version -> String -cabalPkgId (Left _commitid) = "Cabal" -cabalPkgId (Right v) = "Cabal-" ++ showVersion v +cabalPkgId :: CabalVersion -> String +cabalPkgId (CabalHEAD _commitid) = "Cabal" +cabalPkgId (CabalVersion v) = "Cabal-" ++ showVersion v -- cgit v1.2.3