1 import Test
.Cabal
.Prelude
3 -- Test that unqualified command line constraints do not constrain setup
4 -- dependencies. cabal should be able to install the local time-99999 by
5 -- building its setup script with the installed Cabal, which depends on the
6 -- installed time, even though the installed time doesn't fit the constraint.
8 cabal
"v2-build" ["time", "--constraint=time==99999", "--dry-run"]
10 -- Temporarily disabled recording here because output is not stable
11 recordMode DoNotRecord
$ do
12 -- Constraining all uses of 'time' fails because the installed 'time'
13 -- doesn't fit the constraint.
14 r
<- fails
$ cabal
' "v2-build" ["time", "--constraint=any.time==99999", "--dry-run"]
15 assertRegex
"Expected cabal to reject the setup dependency on the installed time"
16 ("rejecting: time:setup.time-[0-9.]*/installed-[^[:space:]]* "
17 ++ "\\(constraint from command line flag requires ==99999\\)")