Skip to content

Commit

Permalink
Add a check of the current behaviour importing duplicates
Browse files Browse the repository at this point in the history
- We don't check if the same config is imported multiple times
  • Loading branch information
philderbeast committed Nov 11, 2024
1 parent cbcc244 commit aa5f8c3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ Could not resolve dependencies:
(constraint from oops-0.project requires ==1.4.3.0)
[__1] fail (backjumping, conflict set: hashable, oops)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), oops (2)
# checking if we detect when the same config is imported via many different paths (we don't)
# cabal v2-build
Up to date
# checking bad conditional
# cabal v2-build
Error: [Cabal-7090]
Expand Down
33 changes: 33 additions & 0 deletions cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,39 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
\ imported by: oops-0.project")
oopsing

-- The project is named yops as it is like hops but with y's for forks.
-- +-- yops-0.project
-- +-- yops/yops-1.config
-- +-- yops-2.config
-- +-- yops/yops-3.config
-- +-- yops-4.config
-- +-- yops/yops-5.config
-- +-- yops-6.config
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-3.config
-- +-- yops-4.config
-- +-- yops/yops-5.config
-- +-- yops-6.config
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-5.config
-- +-- yops-6.config
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-9.config (no further imports)
--
-- We don't check and don't error or warn on the same config being imported
-- via many different paths.
log "checking if we detect when the same config is imported via many different paths (we don't)"
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project" ]

log "checking bad conditional"
badIf <- fails $ cabal' "v2-build" [ "--project-file=bad-conditional.project" ]
assertOutputContains "Cannot set compiler in a conditional clause of a cabal project file" badIf
Expand Down

0 comments on commit aa5f8c3

Please sign in to comment.