Skip to content

Commit

Permalink
Update regression test for issue haskell#4154 after the fix for issue h…
Browse files Browse the repository at this point in the history
…askell#415.

This commit addresses the comments in PR haskell#5183.
  • Loading branch information
grayjay committed Mar 5, 2018
1 parent 87c05e6 commit 2b197f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
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.

0 comments on commit 2b197f8

Please sign in to comment.