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

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

Issue 15889005: Jump past disjoint package on disjoint constraint. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove some debug code. Created 7 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
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 47d71988750061b628ebe4ed55ae6a1c29506f5b..fd49ced02fddd477cada35f75b63b279df966f3d 100644
--- a/sdk/lib/_internal/pub/test/version_solver_test.dart
+++ b/sdk/lib/_internal/pub/test/version_solver_test.dart
@@ -698,6 +698,31 @@ backtracking() {
'baz': '0.0.0'
}, maxTries: 100);
+ // If there's a disjoint constraint on a package, then selecting other
+ // versions of it is a waste of time: no possible versions can match. We need
+ // to jump past it to the most recent package that affected the constraint.
+ testResolve('backjump past failed package on disjoint constraint', {
+ 'myapp 0.0.0': {
+ 'a': 'any',
+ 'foo': '>2.0.0'
+ },
+ 'a 1.0.0': {
+ 'foo': 'any' // ok
+ },
+ 'a 2.0.0': {
+ 'foo': '<1.0.0' // disjoint with myapp's constraint on foo
+ },
+ 'foo 2.0.0': {},
+ 'foo 2.0.1': {},
+ 'foo 2.0.2': {},
+ 'foo 2.0.3': {},
+ 'foo 2.0.4': {}
+ }, result: {
+ 'myapp from root': '0.0.0',
+ 'a': '1.0.0',
+ '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.)
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698