diff --git a/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/Main.hs b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/Main.hs new file mode 100644 index 00000000000..65ae4a05d5d --- /dev/null +++ b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "Hello, Haskell!" diff --git a/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/cabal.project b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/cabal.project new file mode 100644 index 00000000000..b8bb8dbcee2 --- /dev/null +++ b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/cabal.project @@ -0,0 +1 @@ +packages: multiple-cabal-files.cabal multiple-cabal-files2.cabal diff --git a/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/multiple-cabal-files.cabal b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/multiple-cabal-files.cabal new file mode 100644 index 00000000000..fffb8b219f3 --- /dev/null +++ b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/multiple-cabal-files.cabal @@ -0,0 +1,7 @@ +cabal-version: 2.4 +name: multiple-cabal-files +version: 0.1.0.0 + +executable exe + main-is: Main.hs + diff --git a/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/multiple-cabal-files2.cabal b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/multiple-cabal-files2.cabal new file mode 100644 index 00000000000..5edaf1757b5 --- /dev/null +++ b/cabal-testsuite/PackageTests/Ambiguity/multiple-cabal-files/multiple-cabal-files2.cabal @@ -0,0 +1,7 @@ +cabal-version: 2.4 +name: multiple-cabal-files +version: 0.1.0.0 + +executable exe + main-is: Main.hs + diff --git a/cabal-testsuite/PackageTests/Ambiguity/setup-cabal-file.out b/cabal-testsuite/PackageTests/Ambiguity/setup-cabal-file.out new file mode 100644 index 00000000000..507cab132d3 --- /dev/null +++ b/cabal-testsuite/PackageTests/Ambiguity/setup-cabal-file.out @@ -0,0 +1,4 @@ +# cabal v2-build +Error: cabal: Multiple packages have been found: +multiple-cabal-files-0.1.0.0 defined in: ./multiple-cabal-files.cabal +multiple-cabal-files-0.1.0.0 defined in: ./multiple-cabal-files2.cabal diff --git a/cabal-testsuite/PackageTests/Ambiguity/setup-cabal-file.test.hs b/cabal-testsuite/PackageTests/Ambiguity/setup-cabal-file.test.hs new file mode 100644 index 00000000000..df54961f7a9 --- /dev/null +++ b/cabal-testsuite/PackageTests/Ambiguity/setup-cabal-file.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude +-- Test that we can resolve a module name ambiguity when reexporting +-- by explicitly specifying what package we want. +main = cabalTest $ withDirectory "multiple-cabal-files" $ + fails $ cabal "v2-build" []