Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
bfdcd7ee
Commit
bfdcd7ee
authored
Jun 26, 2016
by
kristenk
Browse files
Specify solver goal order in unit test "indepGoals3"
parent
27552af2
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs
View file @
bfdcd7ee
...
...
@@ -135,7 +135,7 @@ tests = [
,
testGroup
"Independent goals"
[
runTest
$
indep
$
mkTest
db16
"indepGoals1"
[
"A"
,
"B"
]
(
SolverSuccess
[(
"A"
,
1
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"D"
,
1
),
(
"D"
,
2
),
(
"E"
,
1
)])
,
runTest
$
testIndepGoals2
"indepGoals2"
,
runTest
$
indep
$
mkTest
db19
"indepGoals3"
[
"D"
,
"E"
,
"F"
]
anySolverFailure
-- The target order is important.
,
runTest
$
testIndepGoals3
"indepGoals3"
,
runTest
$
testIndepGoals4
"indepGoals4"
,
runTest
$
indep
$
mkTest
db23
"indepGoals5"
[
"X"
,
"Y"
]
(
SolverSuccess
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"C"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)])
,
runTest
$
indep
$
mkTest
db24
"indepGoals6"
[
"X"
,
"Y"
]
(
SolverSuccess
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"B"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)])
...
...
@@ -702,16 +702,35 @@ db18 = [
-- > \ | \ / | /
-- > \| V |/
-- > D F E
db19
::
ExampleDb
db19
=
[
Right
$
exAv
"A"
1
[
ExAny
"C"
]
,
Right
$
exAv
"B"
1
[
ExAny
"C"
]
,
Right
$
exAv
"C"
1
[]
,
Right
$
exAv
"C"
2
[]
,
Right
$
exAv
"D"
1
[
ExAny
"A"
,
ExFix
"C"
1
]
,
Right
$
exAv
"E"
1
[
ExAny
"B"
,
ExFix
"C"
2
]
,
Right
$
exAv
"F"
1
[
ExAny
"A"
,
ExAny
"B"
]
]
testIndepGoals3
::
String
->
SolverTest
testIndepGoals3
name
=
goalOrder
goals
$
indep
$
mkTest
db
name
[
"D"
,
"E"
,
"F"
]
anySolverFailure
where
db
::
ExampleDb
db
=
[
Right
$
exAv
"A"
1
[
ExAny
"C"
]
,
Right
$
exAv
"B"
1
[
ExAny
"C"
]
,
Right
$
exAv
"C"
1
[]
,
Right
$
exAv
"C"
2
[]
,
Right
$
exAv
"D"
1
[
ExAny
"A"
,
ExFix
"C"
1
]
,
Right
$
exAv
"E"
1
[
ExAny
"B"
,
ExFix
"C"
2
]
,
Right
$
exAv
"F"
1
[
ExAny
"A"
,
ExAny
"B"
]
]
goals
::
[
ExampleVar
]
goals
=
[
P
(
Indep
0
)
"D"
,
P
(
Indep
0
)
"C"
,
P
(
Indep
0
)
"A"
,
P
(
Indep
1
)
"E"
,
P
(
Indep
1
)
"C"
,
P
(
Indep
1
)
"B"
,
P
(
Indep
2
)
"F"
,
P
(
Indep
2
)
"B"
,
P
(
Indep
2
)
"C"
,
P
(
Indep
2
)
"A"
]
-- | This test checks that the solver correctly backjumps when dependencies
-- of linked packages are not linked. It is an example where the conflict set
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment