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
162d2580
Commit
162d2580
authored
Apr 22, 2016
by
Andres Löh
Browse files
Add two more solver test cases.
parent
4ff4e2b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs
View file @
162d2580
...
...
@@ -133,6 +133,8 @@ tests = [
,
runTest
$
indep
$
mkTest
db17
"indepGoals2"
[
"A"
,
"B"
]
(
Just
[(
"A"
,
1
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"D"
,
1
)])
,
runTest
$
indep
$
mkTest
db19
"indepGoals3"
[
"D"
,
"E"
,
"F"
]
Nothing
-- The target order is important.
,
runTest
$
indep
$
mkTest
db20
"indepGoals4"
[
"C"
,
"A"
,
"B"
]
(
Just
[(
"A"
,
1
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"D"
,
1
),
(
"D"
,
2
)])
,
runTest
$
indep
$
mkTest
db22
"indepGoals5"
[
"X"
,
"Y"
]
(
Just
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"C"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)])
,
runTest
$
indep
$
mkTest
db23
"indepGoals6"
[
"X"
,
"Y"
]
(
Just
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"B"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)])
]
]
where
...
...
@@ -681,6 +683,41 @@ db21 = [
,
Right
$
exAv
"B"
1
[]
]
-- | Database for (unsuccessfully) trying to expose a bug in the handling
-- of implied linking constraints. The question is whether an implied linking
-- constraint should only have the introducing package in its conflict set,
-- or also its link target.
--
-- It turns out that as long as the Single Instance Restriction is in place,
-- it does not matter, because there will aways be an option that is failing
-- due to the SIR, which contains the link target in its conflict set.
--
-- Even if the SIR is not in place, if there is a solution, one will always
-- be found, because without the SIR, linking is always optional, but never
-- necessary.
--
db22
::
ExampleDb
db22
=
[
Right
$
exAv
"X"
1
[
ExFix
"C"
2
,
ExAny
"A"
]
,
Right
$
exAv
"Y"
1
[
ExFix
"C"
1
,
ExFix
"A"
2
]
,
Right
$
exAv
"A"
1
[]
,
Right
$
exAv
"A"
2
[
ExAny
"B"
]
,
Right
$
exAv
"B"
1
[
ExAny
"C"
]
,
Right
$
exAv
"C"
1
[]
,
Right
$
exAv
"C"
2
[]
]
-- | A simplified version of 'db23'.
db23
::
ExampleDb
db23
=
[
Right
$
exAv
"X"
1
[
ExFix
"B"
2
,
ExAny
"A"
]
,
Right
$
exAv
"Y"
1
[
ExFix
"B"
1
,
ExFix
"A"
2
]
,
Right
$
exAv
"A"
1
[]
,
Right
$
exAv
"A"
2
[
ExAny
"B"
]
,
Right
$
exAv
"B"
1
[]
,
Right
$
exAv
"B"
2
[]
]
dbExts1
::
ExampleDb
dbExts1
=
[
Right
$
exAv
"A"
1
[
ExExt
(
EnableExtension
RankNTypes
)]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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