Commit c1caede3 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Port custom-setup/new_build_requires_Cabal_1_20 to new test suite.



Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent ae03fd02
# Regression test for issue #3932
. ./common.sh
cd custom-setup-old-cabal
! cabal new-build > output 2>&1
cat output
grep -q "(issue #3932) requires >=1.20" output || die "Expect constraint failure"
import Test.Cabal.Prelude
main = cabalTest $
-- This repository contains a Cabal-1.18.0.0 option, which would
-- normally would satisfy the repository, except for new-build's
-- extra constraint that setup Cabal must be 1.20. If we don't
-- have a choice like this available, the unsatisfied constraint
-- won't be reported.
withRepo "repo" $ do
fails (cabal' "new-build" []) >>=
assertOutputContains "(issue #3932) requires >=1.20"
name: Cabal
version: 1.18.0.0
build-type: Simple
cabal-version: >= 1.10
library
......@@ -96,6 +96,10 @@ withDirectory f = withReaderT
withEnv :: [(String, Maybe String)] -> TestM a -> TestM a
withEnv e = withReaderT (\env -> env { testEnvironment = testEnvironment env ++ e })
-- HACK please don't use me
withEnvFilter :: (String -> Bool) -> TestM a -> TestM a
withEnvFilter p = withReaderT (\env -> env { testEnvironment = filter (p . fst) (testEnvironment env) })
------------------------------------------------------------------------
-- * Running Setup
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment