Skip to content
Snippets Groups Projects
Commit 2b197f8e authored by kristenk's avatar kristenk
Browse files

Update regression test for issue #4154 after the fix for issue #415.

This commit addresses the comments in PR #5183.
parent 87c05e60
No related branches found
No related tags found
No related merge requests found
# cabal update
Downloading the latest package list from test-local-repo
# cabal new-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
......
......@@ -2,16 +2,20 @@ import Test.Cabal.Prelude
-- Test that unqualified command line constraints do not constrain setup
-- dependencies. cabal should be able to install the local time-99999 by
-- building its setup script with the installed time, even though the installed
-- time doesn't fit the constraint.
main = cabalTest $ withRepo "repo" $ do
-- building its setup script with the installed Cabal, which depends on the
-- installed time, even though the installed time doesn't fit the constraint.
main = cabalTest $ do
-- TODO: Run this test on Windows once #5187 is resolved.
skipIf =<< isWindows
cabal "new-build" ["time", "--constraint=time==99999", "--dry-run"]
-- Temporarily disabled recording here because output is not stable
recordMode DoNotRecord $ do
r <- fails $ cabal' "new-build" ["time", "--constraint=any.time==99999", "--constraint=setup.Cabal installed", "--dry-run"]
-- Constraining all uses of 'time' originally resulted in a cyclic dependency
-- between 'Cabal' and the new 'time':
-- assertOutputContains "cyclic dependencies; conflict set: time:setup.Cabal, time:setup.time" r
-- However, this doesn't work anymore, so instead we more directly look for:
assertOutputContains "time:setup.time~>time-99999 (conflict: time:setup.Cabal" r
-- Constraining all uses of 'time' fails because the installed 'time'
-- doesn't fit the constraint.
r <- fails $ cabal' "new-build" ["time", "--constraint=any.time==99999", "--dry-run"]
assertRegex "Expected cabal to reject the setup dependency on the installed time"
("rejecting: time:setup.time-[0-9.]*/installed-[^[:space:]]* "
++ "\\(constraint from command line flag requires ==99999\\)")
r
name: Cabal
version: 99999
cabal-version: >=1.8
build-type: Simple
library
build-depends: base, time
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment