Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: sdk/lib/_internal/pub/test/version_solver_test.dart

Issue 277633003: Remember previously failed packages when backtracking. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/version_solver_test.dart
diff --git a/sdk/lib/_internal/pub/test/version_solver_test.dart b/sdk/lib/_internal/pub/test/version_solver_test.dart
index caefd2699d723464db074777eb5b870923ab22b4..54c89213f2da40c709f66fbd6e95ac12d2c242c0 100644
--- a/sdk/lib/_internal/pub/test/version_solver_test.dart
+++ b/sdk/lib/_internal/pub/test/version_solver_test.dart
@@ -780,11 +780,29 @@ backtracking() {
'foo': '2.0.4'
}, maxTries: 2);
- // TODO(rnystrom): More tests. In particular:
- // - Tests that demonstrate backtracking for every case that can cause a
- // solution to fail (no versions, disjoint, etc.)
- // - Tests where there are multiple valid solutions and "best" is possibly
- // ambiguous to nail down which order the backtracker tries solutions.
+ // This is a regression test for #18666. It was possible for the solver to
+ // "forget" that a package had previously led to an error. In that case, it
+ // would backtrack over the failed package instead of trying different
+ // versions of it.
+ testResolve("finds solution with less strict constraint", {
+ "myapp 1.0.0": {
+ "a": "any",
+ "c": "any",
+ "d": "any"
+ },
+ "a 2.0.0": {},
+ "a 1.0.0": {},
+ "b 1.0.0": {"a": "1.0.0"},
+ "c 1.0.0": {"b": "any"},
+ "d 2.0.0": {"myapp": "any"},
+ "d 1.0.0": {"myapp": "<1.0.0"}
+ }, result: {
+ 'myapp from root': '1.0.0',
+ 'a': '1.0.0',
+ 'b': '1.0.0',
+ 'c': '1.0.0',
+ 'd': '2.0.0'
+ }, maxTries: 3);
}
sdkConstraint() {

Powered by Google App Engine
This is Rietveld 408576698