Skip to content
GitLab
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
9d7ffb32
Commit
9d7ffb32
authored
Jul 04, 2016
by
kristenk
Browse files
Test default as well as fixed goal order
parent
7cd312a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs
View file @
9d7ffb32
...
...
@@ -137,8 +137,10 @@ tests = [
,
runTest
$
testIndepGoals2
"indepGoals2"
,
runTest
$
testIndepGoals3
"indepGoals3"
,
runTest
$
testIndepGoals4
"indepGoals4"
,
runTest
$
testIndepGoals5
"indepGoals5"
,
runTest
$
testIndepGoals6
"indepGoals6"
,
runTest
$
testIndepGoals5
"indepGoals5 - fixed goal order"
FixedGoalOrder
,
runTest
$
testIndepGoals5
"indepGoals5 - default goal order"
DefaultGoalOrder
,
runTest
$
testIndepGoals6
"indepGoals6 - fixed goal order"
FixedGoalOrder
,
runTest
$
testIndepGoals6
"indepGoals6 - default goal order"
DefaultGoalOrder
]
-- Tests designed for the backjumping blog post
,
testGroup
"Backjumping"
[
...
...
@@ -169,6 +171,8 @@ indep test = test { testIndepGoals = IndependentGoals True }
goalOrder
::
[
ExampleVar
]
->
SolverTest
->
SolverTest
goalOrder
order
test
=
test
{
testGoalOrder
=
Just
order
}
data
GoalOrder
=
FixedGoalOrder
|
DefaultGoalOrder
{-------------------------------------------------------------------------------
Solver tests
-------------------------------------------------------------------------------}
...
...
@@ -804,12 +808,17 @@ db22 = [
-- be found, because without the SIR, linking is always optional, but never
-- necessary.
--
testIndepGoals5
::
String
->
SolverTest
testIndepGoals5
name
=
goalOrder
goals
$
indep
$
mkTest
db
name
[
"X"
,
"Y"
]
$
SolverSuccess
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"C"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)]
testIndepGoals5
::
String
->
GoalOrder
->
SolverTest
testIndepGoals5
name
fixGoalOrder
=
case
fixGoalOrder
of
FixedGoalOrder
->
goalOrder
goals
test
DefaultGoalOrder
->
test
where
test
::
SolverTest
test
=
indep
$
mkTest
db
name
[
"X"
,
"Y"
]
$
SolverSuccess
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"C"
,
1
),
(
"C"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)]
db
::
ExampleDb
db
=
[
Right
$
exAv
"X"
1
[
ExFix
"C"
2
,
ExAny
"A"
]
...
...
@@ -834,12 +843,17 @@ testIndepGoals5 name =
]
-- | A simplified version of 'testIndepGoals5'.
testIndepGoals6
::
String
->
SolverTest
testIndepGoals6
name
=
goalOrder
goals
$
indep
$
mkTest
db
name
[
"X"
,
"Y"
]
$
SolverSuccess
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"B"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)]
testIndepGoals6
::
String
->
GoalOrder
->
SolverTest
testIndepGoals6
name
fixGoalOrder
=
case
fixGoalOrder
of
FixedGoalOrder
->
goalOrder
goals
test
DefaultGoalOrder
->
test
where
test
::
SolverTest
test
=
indep
$
mkTest
db
name
[
"X"
,
"Y"
]
$
SolverSuccess
[(
"A"
,
1
),
(
"A"
,
2
),
(
"B"
,
1
),
(
"B"
,
2
),
(
"X"
,
1
),
(
"Y"
,
1
)]
db
::
ExampleDb
db
=
[
Right
$
exAv
"X"
1
[
ExFix
"B"
2
,
ExAny
"A"
]
...
...
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