Skip to content

Commit

Permalink
Remove old commented tests from pub's beastiary
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Mar 4, 2017
1 parent eba751a commit db8fd63
Showing 1 changed file with 0 additions and 192 deletions.
192 changes: 0 additions & 192 deletions solve_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1600,195 +1600,3 @@ func (dummyLock) InputHash() []byte {
func (dummyLock) Projects() []LockedProject {
return nil
}

// We've borrowed this bestiary from pub's tests:
// https://github.com/dart-lang/pub/blob/master/test/version_solver_test.dart

// TODO(sdboyer) finish converting all of these

/*
func basicGraph() {
testResolve("circular dependency", {
"myapp 1.0.0": {
"foo": "1.0.0"
},
"foo 1.0.0": {
"bar": "1.0.0"
},
"bar 1.0.0": {
"foo": "1.0.0"
}
}, result: {
"myapp from root": "1.0.0",
"foo": "1.0.0",
"bar": "1.0.0"
});
}
func withLockFile() {
}
func rootDependency() {
testResolve("with root source", {
"myapp 1.0.0": {
"foo": "1.0.0"
},
"foo 1.0.0": {
"myapp from root": ">=1.0.0"
}
}, result: {
"myapp from root": "1.0.0",
"foo": "1.0.0"
});
testResolve("with different source", {
"myapp 1.0.0": {
"foo": "1.0.0"
},
"foo 1.0.0": {
"myapp": ">=1.0.0"
}
}, result: {
"myapp from root": "1.0.0",
"foo": "1.0.0"
});
testResolve("with wrong version", {
"myapp 1.0.0": {
"foo": "1.0.0"
},
"foo 1.0.0": {
"myapp": "<1.0.0"
}
}, error: couldNotSolve);
}
func unsolvable() {
testResolve("mismatched descriptions", {
"myapp 0.0.0": {
"foo": "1.0.0",
"bar": "1.0.0"
},
"foo 1.0.0": {
"shared-x": "1.0.0"
},
"bar 1.0.0": {
"shared-y": "1.0.0"
},
"shared-x 1.0.0": {},
"shared-y 1.0.0": {}
}, error: descriptionMismatch("shared", "foo", "bar"));
testResolve("mismatched sources", {
"myapp 0.0.0": {
"foo": "1.0.0",
"bar": "1.0.0"
},
"foo 1.0.0": {
"shared": "1.0.0"
},
"bar 1.0.0": {
"shared from mock2": "1.0.0"
},
"shared 1.0.0": {},
"shared 1.0.0 from mock2": {}
}, error: sourceMismatch("shared", "foo", "bar"));
// This is a regression test for #18300.
testResolve("...", {
"myapp 0.0.0": {
"angular": "any",
"collection": "any"
},
"analyzer 0.12.2": {},
"angular 0.10.0": {
"di": ">=0.0.32 <0.1.0",
"collection": ">=0.9.1 <1.0.0"
},
"angular 0.9.11": {
"di": ">=0.0.32 <0.1.0",
"collection": ">=0.9.1 <1.0.0"
},
"angular 0.9.10": {
"di": ">=0.0.32 <0.1.0",
"collection": ">=0.9.1 <1.0.0"
},
"collection 0.9.0": {},
"collection 0.9.1": {},
"di 0.0.37": {"analyzer": ">=0.13.0 <0.14.0"},
"di 0.0.36": {"analyzer": ">=0.13.0 <0.14.0"}
}, error: noVersion(["analyzer", "di"]), maxTries: 2);
}
func badSource() {
testResolve("fail if the root package has a bad source in dep", {
"myapp 0.0.0": {
"foo from bad": "any"
},
}, error: unknownSource("myapp", "foo", "bad"));
testResolve("fail if the root package has a bad source in dev dep", {
"myapp 0.0.0": {
"(dev) foo from bad": "any"
},
}, error: unknownSource("myapp", "foo", "bad"));
testResolve("fail if all versions have bad source in dep", {
"myapp 0.0.0": {
"foo": "any"
},
"foo 1.0.0": {
"bar from bad": "any"
},
"foo 1.0.1": {
"baz from bad": "any"
},
"foo 1.0.3": {
"bang from bad": "any"
},
}, error: unknownSource("foo", "bar", "bad"), maxTries: 3);
testResolve("ignore versions with bad source in dep", {
"myapp 1.0.0": {
"foo": "any"
},
"foo 1.0.0": {
"bar": "any"
},
"foo 1.0.1": {
"bar from bad": "any"
},
"foo 1.0.3": {
"bar from bad": "any"
},
"bar 1.0.0": {}
}, result: {
"myapp from root": "1.0.0",
"foo": "1.0.0",
"bar": "1.0.0"
}, maxTries: 3);
}
func backtracking() {
testResolve("circular dependency on older version", {
"myapp 0.0.0": {
"a": ">=1.0.0"
},
"a 1.0.0": {},
"a 2.0.0": {
"b": "1.0.0"
},
"b 1.0.0": {
"a": "1.0.0"
}
}, result: {
"myapp from root": "0.0.0",
"a": "1.0.0"
}, maxTries: 2);
}
*/

0 comments on commit db8fd63

Please sign in to comment.