@@ -182,6 +182,8 @@ tests =
182
182
, runTest $ mkTest db9 " setupDeps7" [" F" , " G" ] (solverSuccess [(" A" , 1 ), (" B" , 1 ), (" B" , 2 ), (" C" , 1 ), (" D" , 1 ), (" E" , 1 ), (" E" , 2 ), (" F" , 1 ), (" G" , 1 )])
183
183
, runTest $ mkTest db10 " setupDeps8" [" C" ] (solverSuccess [(" C" , 1 )])
184
184
, runTest $ indep $ mkTest dbSetupDeps " setupDeps9" [" A" , " B" ] (solverSuccess [(" A" , 1 ), (" B" , 1 ), (" C" , 1 ), (" D" , 1 ), (" D" , 2 )])
185
+ , runTest $ setupStanzaTest1
186
+ , runTest $ setupStanzaTest2
185
187
]
186
188
, testGroup
187
189
" Base shim"
@@ -2555,6 +2557,32 @@ dbIssue3775 =
2555
2557
, Right $ exAv " B" 2 [ExAny " A" , ExAny " warp" ]
2556
2558
]
2557
2559
2560
+ -- A database where the setup depends on something which has a test stanza, does the
2561
+ -- test stanza get enabled?
2562
+ dbSetupStanza :: ExampleDb
2563
+ dbSetupStanza =
2564
+ [ Right $
2565
+ exAv " A" 1 []
2566
+ `withSetupDeps` [ExAny " B" ]
2567
+ , Right $
2568
+ exAv " B" 1 []
2569
+ `withTest` exTest " test" [ExAny " C" ]
2570
+ ]
2571
+
2572
+ -- With the "top-level" qualifier syntax
2573
+ setupStanzaTest1 :: SolverTest
2574
+ setupStanzaTest1 = constraints [ExStanzaConstraint (scopeToplevel " B" ) [TestStanzas ]] $ mkTest dbSetupStanza " setupStanzaTest1" [" A" ] (solverSuccess [(" A" , 1 ), (" B" , 1 )])
2575
+
2576
+ -- With the "any" qualifier syntax
2577
+ setupStanzaTest2 :: SolverTest
2578
+ setupStanzaTest2 =
2579
+ constraints [ExStanzaConstraint (ScopeAnyQualifier " B" ) [TestStanzas ]] $
2580
+ mkTest
2581
+ dbSetupStanza
2582
+ " setupStanzaTest2"
2583
+ [" A" ]
2584
+ (solverFailure (" unknown package: A:setup.C (dependency of A:setup.B *test)" `isInfixOf` ))
2585
+
2558
2586
-- | Returns true if the second list contains all elements of the first list, in
2559
2587
-- order.
2560
2588
containsInOrder :: Eq a => [a ] -> [a ] -> Bool
0 commit comments