Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Fix gps solver tests
Browse files Browse the repository at this point in the history
Stupid variable assignment in loop was broken. Also, add one more test
case to check that a root require causes corresponding constraints to be
activated.
  • Loading branch information
sdboyer committed Aug 1, 2017
1 parent b6765a5 commit 8a46f4d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/gps/solve_bimodal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,23 @@ var bimodalFixtures = map[string]bimodalFixture{
"baz 1.0.0",
),
},
"require activates constraints": {
ds: []depspec{
dsp(mkDepspec("root 0.0.0", "foo 1.0.0", "bar 1.0.0"),
pkg("root", "foo")),
dsp(mkDepspec("foo 1.0.0"),
pkg("foo", "bar")),
dsp(mkDepspec("bar 1.0.0"),
pkg("bar")),
dsp(mkDepspec("bar 1.1.0"),
pkg("bar")),
},
require: []string{"bar"},
r: mksolution(
"foo 1.0.0",
"bar 1.0.0",
),
},
"require subpackage": {
ds: []depspec{
dsp(mkDepspec("root 0.0.0", "bar 1.0.0"),
Expand Down
2 changes: 2 additions & 0 deletions internal/gps/solve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func TestBasicSolves(t *testing.T) {

sort.Strings(names)
for _, n := range names {
n := n
t.Run(n, func(t *testing.T) {
t.Parallel()
solveBasicsAndCheck(basicFixtures[n], t)
Expand Down Expand Up @@ -116,6 +117,7 @@ func TestBimodalSolves(t *testing.T) {

sort.Strings(names)
for _, n := range names {
n := n
t.Run(n, func(t *testing.T) {
t.Parallel()
solveBimodalAndCheck(bimodalFixtures[n], t)
Expand Down

0 comments on commit 8a46f4d

Please sign in to comment.