Skip to content

Commit 3903526

Browse files
committed
Add a check of the current behaviour importing duplicates
- We don't check if the same config is imported multiple times
1 parent 2938c03 commit 3903526

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ Could not resolve dependencies:
124124
(constraint from oops-0.project requires ==1.4.3.0)
125125
[__1] fail (backjumping, conflict set: hashable, oops)
126126
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), oops (2)
127+
# checking if we detect when the same config is imported via many different paths (we don't)
128+
# cabal v2-build
129+
Up to date
127130
# checking bad conditional
128131
# cabal v2-build
129132
Error: [Cabal-7090]

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,39 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
225225
\ imported by: oops-0.project")
226226
oopsing
227227

228+
-- The project is named yops as it is like hops but with y's for forks.
229+
-- +-- yops-0.project
230+
-- +-- yops/yops-1.config
231+
-- +-- yops-2.config
232+
-- +-- yops/yops-3.config
233+
-- +-- yops-4.config
234+
-- +-- yops/yops-5.config
235+
-- +-- yops-6.config
236+
-- +-- yops/yops-7.config
237+
-- +-- yops-8.config
238+
-- +-- yops/yops-9.config (no further imports)
239+
-- +-- yops/yops-3.config
240+
-- +-- yops-4.config
241+
-- +-- yops/yops-5.config
242+
-- +-- yops-6.config
243+
-- +-- yops/yops-7.config
244+
-- +-- yops-8.config
245+
-- +-- yops/yops-9.config (no further imports)
246+
-- +-- yops/yops-5.config
247+
-- +-- yops-6.config
248+
-- +-- yops/yops-7.config
249+
-- +-- yops-8.config
250+
-- +-- yops/yops-9.config (no further imports)
251+
-- +-- yops/yops-7.config
252+
-- +-- yops-8.config
253+
-- +-- yops/yops-9.config (no further imports)
254+
-- +-- yops/yops-9.config (no further imports)
255+
--
256+
-- We don't check and don't error or warn on the same config being imported
257+
-- via many different paths.
258+
log "checking if we detect when the same config is imported via many different paths (we don't)"
259+
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project" ]
260+
228261
log "checking bad conditional"
229262
badIf <- fails $ cabal' "v2-build" [ "--project-file=bad-conditional.project" ]
230263
assertOutputContains "Cannot set compiler in a conditional clause of a cabal project file" badIf

0 commit comments

Comments
 (0)