Skip to content

Update regression test for issue #4154 after the fix for issue #415. (2.2) #5192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# cabal update
Downloading the latest package list from test-local-repo
# cabal new-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

This file was deleted.