aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-01-12 18:50:59 +0100
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commit7ad0ec9474d6df6fa1a246856b31ad849809b5de (patch)
treeeb42c68272d457550a2227bf8319e9a08a7b4be9 /tests
parentcb5c401a93c764a732c06d1b45edc02787700dbb (diff)
Refactor to introduce Cabal version type
Diffstat (limited to 'tests')
-rw-r--r--tests/CompileTest.hs20
1 files changed, 10 insertions, 10 deletions
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