Skip to content

Commit 0ffb925

Browse files
committed
Add Y-forking import test
- A test for detecting when the same config is imported via many different paths .
1 parent 47e7295 commit 0ffb925

File tree

12 files changed

+49
-0
lines changed

12 files changed

+49
-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 that we detect when the same config is imported via many different paths
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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,36 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
222222
\ imported by: oops-0.project"
223223
oopsing
224224

225+
-- The project is named yops as it is like hops but with y's for forks.
226+
-- +-- yops-0.project
227+
-- +-- yops/yops-1.config
228+
-- +-- yops-2.config
229+
-- +-- yops/yops-3.config
230+
-- +-- yops-4.config
231+
-- +-- yops/yops-5.config
232+
-- +-- yops-6.config
233+
-- +-- yops/yops-7.config
234+
-- +-- yops-8.config
235+
-- +-- yops/yops-9.config (no further imports)
236+
-- +-- yops/yops-3.config
237+
-- +-- yops-4.config
238+
-- +-- yops/yops-5.config
239+
-- +-- yops-6.config
240+
-- +-- yops/yops-7.config
241+
-- +-- yops-8.config
242+
-- +-- yops/yops-9.config (no further imports)
243+
-- +-- yops/yops-5.config
244+
-- +-- yops-6.config
245+
-- +-- yops/yops-7.config
246+
-- +-- yops-8.config
247+
-- +-- yops/yops-9.config (no further imports)
248+
-- +-- yops/yops-7.config
249+
-- +-- yops-8.config
250+
-- +-- yops/yops-9.config (no further imports)
251+
-- +-- yops/yops-9.config (no further imports)
252+
log "checking that we detect when the same config is imported via many different paths"
253+
hopping <- fails $ cabal' "v2-build" [ "--project-file=yops-0.project" ]
254+
225255
log "checking bad conditional"
226256
badIf <- fails $ cabal' "v2-build" [ "--project-file=bad-conditional.project" ]
227257
assertOutputContains "Cannot set compiler in a conditional clause of a cabal project file" badIf
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
packages: .
2+
3+
import: yops/yops-1.config
4+
import: yops/yops-3.config
5+
import: yops/yops-5.config
6+
import: yops/yops-7.config
7+
import: yops/yops-9.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: yops/yops-3.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: yops/yops-5.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: yops/yops-7.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: yops/yops-9.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: ../yops-2.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: ../yops-4.config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import: ../yops-6.config

0 commit comments

Comments
 (0)