1 import Test
.Cabal
.Prelude
3 -- Test that "cabal v2-build pkg" builds the local pkg-1.0, which has an exe
4 -- that prints a unique message. It should not build 1.0 or 2.0 from the
6 main
= cabalTest
$ withRepo
"repo" $ do
7 cabal
"v2-build" ["pkg"]
9 r
<- runPlanExe
' "pkg" "my-exe" []
10 assertOutputContains
"local pkg-1.0" r
12 -- cabal shouldn't build a package from the repo, even when given a constraint
13 -- that only matches a non-local package.
14 r
<- fails
$ cabal
' "v2-build" ["pkg", "-c", "pkg==2.0"]
15 assertOutputContains
"rejecting: pkg-2.0" r