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

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

Issue 887223007: Revert "Use native async/await support in pub." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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_generated/test/version_solver_test.dart
diff --git a/sdk/lib/_internal/pub/test/version_solver_test.dart b/sdk/lib/_internal/pub_generated/test/version_solver_test.dart
similarity index 81%
copy from sdk/lib/_internal/pub/test/version_solver_test.dart
copy to sdk/lib/_internal/pub_generated/test/version_solver_test.dart
index cdadb67f9f9776626b18fb3cf37ad76f42f61a8f..f013a8821c8bfaed345563891c276e071e910ec1 100644
--- a/sdk/lib/_internal/pub/test/version_solver_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/version_solver_test.dart
@@ -103,17 +103,27 @@ void basicGraph() {
'shared': '3.6.9'
});
- testResolve('shared dependency where dependent version in turn affects '
- 'other dependencies', {
+ testResolve(
+ 'shared dependency where dependent version in turn affects '
+ 'other dependencies',
+ {
'myapp 0.0.0': {
'foo': '<=1.0.2',
'bar': '1.0.0'
},
'foo 1.0.0': {},
- 'foo 1.0.1': { 'bang': '1.0.0' },
- 'foo 1.0.2': { 'whoop': '1.0.0' },
- 'foo 1.0.3': { 'zoop': '1.0.0' },
- 'bar 1.0.0': { 'foo': '<=1.0.1' },
+ 'foo 1.0.1': {
+ 'bang': '1.0.0'
+ },
+ 'foo 1.0.2': {
+ 'whoop': '1.0.0'
+ },
+ 'foo 1.0.3': {
+ 'zoop': '1.0.0'
+ },
+ 'bar 1.0.0': {
+ 'foo': '<=1.0.1'
+ },
'bang 1.0.0': {},
'whoop 1.0.0': {},
'zoop 1.0.0': {}
@@ -146,9 +156,15 @@ withLockFile() {
'myapp 0.0.0': {
'foo': 'any'
},
- 'foo 1.0.0': { 'bar': '1.0.0' },
- 'foo 1.0.1': { 'bar': '1.0.1' },
- 'foo 1.0.2': { 'bar': '1.0.2' },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 1.0.1': {
+ 'bar': '1.0.1'
+ },
+ 'foo 1.0.2': {
+ 'bar': '1.0.2'
+ },
'bar 1.0.0': {},
'bar 1.0.1': {},
'bar 1.0.2': {}
@@ -164,9 +180,15 @@ withLockFile() {
'myapp 0.0.0': {
'foo': '>1.0.1'
},
- 'foo 1.0.0': { 'bar': '1.0.0' },
- 'foo 1.0.1': { 'bar': '1.0.1' },
- 'foo 1.0.2': { 'bar': '1.0.2' },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 1.0.1': {
+ 'bar': '1.0.1'
+ },
+ 'foo 1.0.2': {
+ 'bar': '1.0.2'
+ },
'bar 1.0.0': {},
'bar 1.0.1': {},
'bar 1.0.2': {}
@@ -182,9 +204,15 @@ withLockFile() {
'myapp 0.0.0': {
'foo': 'any'
},
- 'foo 1.0.0': { 'bar': '1.0.0' },
- 'foo 1.0.1': { 'bar': '1.0.1' },
- 'foo 1.0.2': { 'bar': '1.0.2' },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 1.0.1': {
+ 'bar': '1.0.1'
+ },
+ 'foo 1.0.2': {
+ 'bar': '1.0.2'
+ },
'bar 1.0.0': {},
'bar 1.0.1': {},
'bar 1.0.2': {},
@@ -197,21 +225,37 @@ withLockFile() {
'bar': '1.0.2'
});
- testResolve('unlocks dependencies if necessary to ensure that a new '
- 'dependency is satisfied', {
+ testResolve(
+ 'unlocks dependencies if necessary to ensure that a new '
+ 'dependency is satisfied',
+ {
'myapp 0.0.0': {
'foo': 'any',
'newdep': 'any'
},
- 'foo 1.0.0': { 'bar': '<2.0.0' },
- 'bar 1.0.0': { 'baz': '<2.0.0' },
- 'baz 1.0.0': { 'qux': '<2.0.0' },
+ 'foo 1.0.0': {
+ 'bar': '<2.0.0'
+ },
+ 'bar 1.0.0': {
+ 'baz': '<2.0.0'
+ },
+ 'baz 1.0.0': {
+ 'qux': '<2.0.0'
+ },
'qux 1.0.0': {},
- 'foo 2.0.0': { 'bar': '<3.0.0' },
- 'bar 2.0.0': { 'baz': '<3.0.0' },
- 'baz 2.0.0': { 'qux': '<3.0.0' },
+ 'foo 2.0.0': {
+ 'bar': '<3.0.0'
+ },
+ 'bar 2.0.0': {
+ 'baz': '<3.0.0'
+ },
+ 'baz 2.0.0': {
+ 'qux': '<3.0.0'
+ },
'qux 2.0.0': {},
- 'newdep 2.0.0': { 'baz': '>=1.5.0' }
+ 'newdep 2.0.0': {
+ 'baz': '>=1.5.0'
+ }
}, lockfile: {
'foo': '1.0.0',
'bar': '1.0.0',
@@ -437,8 +481,12 @@ unsolvable() {
},
"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"}
+ "di 0.0.37": {
+ "analyzer": ">=0.13.0 <0.14.0"
+ },
+ "di 0.0.36": {
+ "analyzer": ">=0.13.0 <0.14.0"
+ }
}, error: noVersion(['myapp', 'angular', 'collection']), maxTries: 9);
}
@@ -538,13 +586,27 @@ backtracking() {
// Only one version of baz, so foo and bar will have to downgrade until they
// reach it.
testResolve('simple transitive', {
- 'myapp 0.0.0': {'foo': 'any'},
- 'foo 1.0.0': {'bar': '1.0.0'},
- 'foo 2.0.0': {'bar': '2.0.0'},
- 'foo 3.0.0': {'bar': '3.0.0'},
- 'bar 1.0.0': {'baz': 'any'},
- 'bar 2.0.0': {'baz': '2.0.0'},
- 'bar 3.0.0': {'baz': '3.0.0'},
+ 'myapp 0.0.0': {
+ 'foo': 'any'
+ },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 2.0.0': {
+ 'bar': '2.0.0'
+ },
+ 'foo 3.0.0': {
+ 'bar': '3.0.0'
+ },
+ 'bar 1.0.0': {
+ 'baz': 'any'
+ },
+ 'bar 2.0.0': {
+ 'baz': '2.0.0'
+ },
+ 'bar 3.0.0': {
+ 'baz': '3.0.0'
+ },
'baz 1.0.0': {}
}, result: {
'myapp from root': '0.0.0',
@@ -562,8 +624,12 @@ backtracking() {
'a': 'any',
'b': 'any'
},
- 'a 1.0.0': { 'c': '1.0.0' },
- 'a 2.0.0': { 'c': '2.0.0-nonexistent' },
+ 'a 1.0.0': {
+ 'c': '1.0.0'
+ },
+ 'a 2.0.0': {
+ 'c': '2.0.0-nonexistent'
+ },
'b 1.0.0': {},
'b 2.0.0': {},
'b 3.0.0': {},
@@ -690,15 +756,33 @@ backtracking() {
'a': 'any',
'b': 'any'
},
- 'a 1.0.0': {'c': 'any'},
- 'a 2.0.0': {'c': 'any'},
- 'a 3.0.0': {'c': 'any'},
- 'a 4.0.0': {'c': 'any'},
- 'a 5.0.0': {'c': '1.0.0'},
- 'b 1.0.0': {'c': 'any'},
- 'b 2.0.0': {'c': 'any'},
- 'b 3.0.0': {'c': 'any'},
- 'b 4.0.0': {'c': '2.0.0'},
+ 'a 1.0.0': {
+ 'c': 'any'
+ },
+ 'a 2.0.0': {
+ 'c': 'any'
+ },
+ 'a 3.0.0': {
+ 'c': 'any'
+ },
+ 'a 4.0.0': {
+ 'c': 'any'
+ },
+ 'a 5.0.0': {
+ 'c': '1.0.0'
+ },
+ 'b 1.0.0': {
+ 'c': 'any'
+ },
+ 'b 2.0.0': {
+ 'c': 'any'
+ },
+ 'b 3.0.0': {
+ 'c': 'any'
+ },
+ 'b 4.0.0': {
+ 'c': '2.0.0'
+ },
'c 1.0.0': {},
'c 2.0.0': {},
}, result: {
@@ -719,10 +803,18 @@ backtracking() {
"foo": ">2.0.0",
"bar": "any"
},
- "foo 1.0.0": {"none": "2.0.0"},
- "foo 2.0.0": {"none": "2.0.0"},
- "foo 3.0.0": {"none": "2.0.0"},
- "foo 4.0.0": {"none": "2.0.0"},
+ "foo 1.0.0": {
+ "none": "2.0.0"
+ },
+ "foo 2.0.0": {
+ "none": "2.0.0"
+ },
+ "foo 3.0.0": {
+ "none": "2.0.0"
+ },
+ "foo 4.0.0": {
+ "none": "2.0.0"
+ },
"bar 1.0.0": {},
"bar 2.0.0": {},
"bar 3.0.0": {},
@@ -744,8 +836,12 @@ backtracking() {
for (var i = 0; i < 10; i++) {
for (var j = 0; j < 10; j++) {
- map['foo $i.$j.0'] = {'baz': '$i.0.0'};
- map['bar $i.$j.0'] = {'baz': '0.$j.0'};
+ map['foo $i.$j.0'] = {
+ 'baz': '$i.0.0'
+ };
+ map['bar $i.$j.0'] = {
+ 'baz': '0.$j.0'
+ };
}
}
@@ -793,10 +889,18 @@ backtracking() {
},
"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"}
+ "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',
@@ -811,61 +915,117 @@ sdkConstraint() {
var goodVersion = sdk.version.toString();
testResolve('root matches SDK', {
- 'myapp 0.0.0': {'sdk': goodVersion }
+ 'myapp 0.0.0': {
+ 'sdk': goodVersion
+ }
}, result: {
'myapp from root': '0.0.0'
});
testResolve('root does not match SDK', {
- 'myapp 0.0.0': {'sdk': badVersion }
+ 'myapp 0.0.0': {
+ 'sdk': badVersion
+ }
}, error: couldNotSolve);
testResolve('dependency does not match SDK', {
- 'myapp 0.0.0': {'foo': 'any'},
- 'foo 0.0.0': {'sdk': badVersion }
+ 'myapp 0.0.0': {
+ 'foo': 'any'
+ },
+ 'foo 0.0.0': {
+ 'sdk': badVersion
+ }
}, error: couldNotSolve);
testResolve('transitive dependency does not match SDK', {
- 'myapp 0.0.0': {'foo': 'any'},
- 'foo 0.0.0': {'bar': 'any'},
- 'bar 0.0.0': {'sdk': badVersion }
+ 'myapp 0.0.0': {
+ 'foo': 'any'
+ },
+ 'foo 0.0.0': {
+ 'bar': 'any'
+ },
+ 'bar 0.0.0': {
+ 'sdk': badVersion
+ }
}, error: couldNotSolve);
testResolve('selects a dependency version that allows the SDK', {
- 'myapp 0.0.0': {'foo': 'any'},
- 'foo 1.0.0': {'sdk': goodVersion },
- 'foo 2.0.0': {'sdk': goodVersion },
- 'foo 3.0.0': {'sdk': badVersion },
- 'foo 4.0.0': {'sdk': badVersion }
+ 'myapp 0.0.0': {
+ 'foo': 'any'
+ },
+ 'foo 1.0.0': {
+ 'sdk': goodVersion
+ },
+ 'foo 2.0.0': {
+ 'sdk': goodVersion
+ },
+ 'foo 3.0.0': {
+ 'sdk': badVersion
+ },
+ 'foo 4.0.0': {
+ 'sdk': badVersion
+ }
}, result: {
'myapp from root': '0.0.0',
'foo': '2.0.0'
}, maxTries: 3);
testResolve('selects a transitive dependency version that allows the SDK', {
- 'myapp 0.0.0': {'foo': 'any'},
- 'foo 1.0.0': {'bar': 'any'},
- 'bar 1.0.0': {'sdk': goodVersion },
- 'bar 2.0.0': {'sdk': goodVersion },
- 'bar 3.0.0': {'sdk': badVersion },
- 'bar 4.0.0': {'sdk': badVersion }
+ 'myapp 0.0.0': {
+ 'foo': 'any'
+ },
+ 'foo 1.0.0': {
+ 'bar': 'any'
+ },
+ 'bar 1.0.0': {
+ 'sdk': goodVersion
+ },
+ 'bar 2.0.0': {
+ 'sdk': goodVersion
+ },
+ 'bar 3.0.0': {
+ 'sdk': badVersion
+ },
+ 'bar 4.0.0': {
+ 'sdk': badVersion
+ }
}, result: {
'myapp from root': '0.0.0',
'foo': '1.0.0',
'bar': '2.0.0'
}, maxTries: 3);
- testResolve('selects a dependency version that allows a transitive '
- 'dependency that allows the SDK', {
- 'myapp 0.0.0': {'foo': 'any'},
- 'foo 1.0.0': {'bar': '1.0.0'},
- 'foo 2.0.0': {'bar': '2.0.0'},
- 'foo 3.0.0': {'bar': '3.0.0'},
- 'foo 4.0.0': {'bar': '4.0.0'},
- 'bar 1.0.0': {'sdk': goodVersion },
- 'bar 2.0.0': {'sdk': goodVersion },
- 'bar 3.0.0': {'sdk': badVersion },
- 'bar 4.0.0': {'sdk': badVersion }
+ testResolve(
+ 'selects a dependency version that allows a transitive '
+ 'dependency that allows the SDK',
+ {
+ 'myapp 0.0.0': {
+ 'foo': 'any'
+ },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 2.0.0': {
+ 'bar': '2.0.0'
+ },
+ 'foo 3.0.0': {
+ 'bar': '3.0.0'
+ },
+ 'foo 4.0.0': {
+ 'bar': '4.0.0'
+ },
+ 'bar 1.0.0': {
+ 'sdk': goodVersion
+ },
+ 'bar 2.0.0': {
+ 'sdk': goodVersion
+ },
+ 'bar 3.0.0': {
+ 'sdk': badVersion
+ },
+ 'bar 4.0.0': {
+ 'sdk': badVersion
+ }
}, result: {
'myapp from root': '0.0.0',
'foo': '2.0.0',
@@ -1001,9 +1161,15 @@ void override() {
'myapp 0.0.0': {
'foo': 'any'
},
- 'foo 1.0.0': { 'bar': '1.0.0' },
- 'foo 1.0.1': { 'bar': '1.0.1' },
- 'foo 1.0.2': { 'bar': '1.0.2' },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 1.0.1': {
+ 'bar': '1.0.1'
+ },
+ 'foo 1.0.2': {
+ 'bar': '1.0.2'
+ },
'bar 1.0.0': {},
'bar 1.0.1': {},
'bar 1.0.2': {}
@@ -1021,9 +1187,15 @@ void override() {
'myapp 0.0.0': {
'foo': 'any'
},
- 'foo 1.0.0': { 'bar': '1.0.0' },
- 'foo 1.0.1': { 'bar': '1.0.1' },
- 'foo 1.0.2': { 'bar': '1.0.2' },
+ 'foo 1.0.0': {
+ 'bar': '1.0.0'
+ },
+ 'foo 1.0.1': {
+ 'bar': '1.0.1'
+ },
+ 'foo 1.0.2': {
+ 'bar': '1.0.2'
+ },
'bar 1.0.0': {},
'bar 1.0.1': {},
'bar 1.0.2': {}
@@ -1074,8 +1246,10 @@ void downgrade() {
'foo': '2.0.0'
}, downgrade: true);
- testResolve('use earliest allowed prerelease if no stable versions match '
- 'while downgrading', {
+ testResolve(
+ 'use earliest allowed prerelease if no stable versions match '
+ 'while downgrading',
+ {
'myapp 0.0.0': {
'a': '>=2.0.0-dev.1 <3.0.0'
},
@@ -1089,27 +1263,38 @@ void downgrade() {
}, downgrade: true);
}
-testResolve(String description, Map packages, {
- Map lockfile, Map overrides, Map result, FailMatcherBuilder error,
- int maxTries, bool downgrade: false}) {
- _testResolve(test, description, packages, lockfile: lockfile,
- overrides: overrides, result: result, error: error, maxTries: maxTries,
+testResolve(String description, Map packages, {Map lockfile, Map overrides,
+ Map result, FailMatcherBuilder error, int maxTries, bool downgrade: false}) {
+ _testResolve(
+ test,
+ description,
+ packages,
+ lockfile: lockfile,
+ overrides: overrides,
+ result: result,
+ error: error,
+ maxTries: maxTries,
downgrade: downgrade);
}
-solo_testResolve(String description, Map packages, {
- Map lockfile, Map overrides, Map result, FailMatcherBuilder error,
- int maxTries, bool downgrade: false}) {
+solo_testResolve(String description, Map packages, {Map lockfile, Map overrides,
+ Map result, FailMatcherBuilder error, int maxTries, bool downgrade: false}) {
log.verbosity = log.Verbosity.SOLVER;
- _testResolve(solo_test, description, packages, lockfile: lockfile,
- overrides: overrides, result: result, error: error, maxTries: maxTries,
+ _testResolve(
+ solo_test,
+ description,
+ packages,
+ lockfile: lockfile,
+ overrides: overrides,
+ result: result,
+ error: error,
+ maxTries: maxTries,
downgrade: downgrade);
}
-_testResolve(void testFn(String description, Function body),
- String description, Map packages, {
- Map lockfile, Map overrides, Map result, FailMatcherBuilder error,
- int maxTries, bool downgrade: false}) {
+_testResolve(void testFn(String description, Function body), String description,
+ Map packages, {Map lockfile, Map overrides, Map result,
+ FailMatcherBuilder error, int maxTries, bool downgrade: false}) {
if (maxTries == null) maxTries = 1;
testFn(description, () {
@@ -1124,8 +1309,8 @@ _testResolve(void testFn(String description, Function body),
var root;
packages.forEach((description, dependencies) {
var id = parseSpec(description);
- var package = mockPackage(id, dependencies,
- id.name == 'myapp' ? overrides : null);
+ var package =
+ mockPackage(id, dependencies, id.name == 'myapp' ? overrides : null);
if (id.name == 'myapp') {
// Don't add the root package to the server, so we can verify that Pub
// doesn't try to look up information about the local package on the
@@ -1133,7 +1318,8 @@ _testResolve(void testFn(String description, Function body),
root = package;
} else {
(cache.sources[id.source] as MockSource).addPackage(
- id.description, package);
+ id.description,
+ package);
}
});
@@ -1160,7 +1346,9 @@ _testResolve(void testFn(String description, Function body),
// Resolve the versions.
var future = resolveVersions(
downgrade ? SolveType.DOWNGRADE : SolveType.GET,
- cache.sources, root, lockFile: realLockFile);
+ cache.sources,
+ root,
+ lockFile: realLockFile);
var matcher;
if (result != null) {
@@ -1176,19 +1364,22 @@ _testResolve(void testFn(String description, Function body),
typedef SolveFailMatcher FailMatcherBuilder(int maxTries);
FailMatcherBuilder noVersion(List<String> packages) {
- return (maxTries) => new SolveFailMatcher(packages, maxTries,
- NoVersionException);
+ return (maxTries) =>
+ new SolveFailMatcher(packages, maxTries, NoVersionException);
}
FailMatcherBuilder disjointConstraint(List<String> packages) {
- return (maxTries) => new SolveFailMatcher(packages, maxTries,
- DisjointConstraintException);
+ return (maxTries) =>
+ new SolveFailMatcher(packages, maxTries, DisjointConstraintException);
}
-FailMatcherBuilder descriptionMismatch(
- String package, String depender1, String depender2) {
- return (maxTries) => new SolveFailMatcher([package, depender1, depender2],
- maxTries, DescriptionMismatchException);
+FailMatcherBuilder descriptionMismatch(String package, String depender1,
+ String depender2) {
+ return (maxTries) =>
+ new SolveFailMatcher(
+ [package, depender1, depender2],
+ maxTries,
+ DescriptionMismatchException);
}
// If no solution can be found, the solver just reports the last failure that
@@ -1197,15 +1388,21 @@ FailMatcherBuilder descriptionMismatch(
SolveFailMatcher couldNotSolve(maxTries) =>
new SolveFailMatcher([], maxTries, null);
-FailMatcherBuilder sourceMismatch(
- String package, String depender1, String depender2) {
- return (maxTries) => new SolveFailMatcher([package, depender1, depender2],
- maxTries, SourceMismatchException);
+FailMatcherBuilder sourceMismatch(String package, String depender1,
+ String depender2) {
+ return (maxTries) =>
+ new SolveFailMatcher(
+ [package, depender1, depender2],
+ maxTries,
+ SourceMismatchException);
}
unknownSource(String depender, String dependency, String source) {
- return (maxTries) => new SolveFailMatcher([depender, dependency, source],
- maxTries, UnknownSourceException);
+ return (maxTries) =>
+ new SolveFailMatcher(
+ [depender, dependency, source],
+ maxTries,
+ UnknownSourceException);
}
class SolveSuccessMatcher implements Matcher {
@@ -1221,12 +1418,11 @@ class SolveSuccessMatcher implements Matcher {
Description describe(Description description) {
return description.add(
'Solver to use at most $_maxTries attempts to find:\n'
- '${_listPackages(_expected.values)}');
+ '${_listPackages(_expected.values)}');
}
- Description describeMismatch(SolveResult result,
- Description description,
- Map state, bool verbose) {
+ Description describeMismatch(SolveResult result, Description description,
+ Map state, bool verbose) {
if (!result.succeeded) {
description.add('Solver failed with:\n${result.error}');
return null;
@@ -1300,9 +1496,8 @@ class SolveFailMatcher implements Matcher {
return description;
}
- Description describeMismatch(SolveResult result,
- Description description,
- Map state, bool verbose) {
+ Description describeMismatch(SolveResult result, Description description,
+ Map state, bool verbose) {
description.add(state['failures']);
return description;
}
@@ -1314,8 +1509,8 @@ class SolveFailMatcher implements Matcher {
failures.writeln('Solver succeeded');
} else {
if (_expectedType != null && result.error.runtimeType != _expectedType) {
- failures.writeln('Should have error type $_expectedType, got '
- '${result.error.runtimeType}');
+ failures.writeln(
+ 'Should have error type $_expectedType, got ' '${result.error.runtimeType}');
}
var message = result.error.toString();
@@ -1368,7 +1563,8 @@ class MockSource extends CachedSource {
MockSource(this.name);
dynamic parseDescription(String containingPath, description,
- {bool fromLockFile: false}) => description;
+ {bool fromLockFile: false}) =>
+ description;
bool descriptionsEqual(description1, description2) =>
description1 == description2;
@@ -1381,15 +1577,15 @@ class MockSource extends CachedSource {
return new Future.sync(() {
// Make sure the solver doesn't request the same thing twice.
if (_requestedVersions.contains(description)) {
- throw new Exception('Version list for $description was already '
- 'requested.');
+ throw new Exception(
+ 'Version list for $description was already ' 'requested.');
}
_requestedVersions.add(description);
- if (!_packages.containsKey(description)){
- throw new Exception('MockSource does not have a package matching '
- '"$description".');
+ if (!_packages.containsKey(description)) {
+ throw new Exception(
+ 'MockSource does not have a package matching ' '"$description".');
}
return _packages[description].keys.toList();
@@ -1439,8 +1635,8 @@ Package mockPackage(PackageId id, Map dependencyStrings, Map overrides) {
spec = spec.substring("(dev) ".length);
}
- var dep = parseSpec(spec).withConstraint(
- new VersionConstraint.parse(constraint));
+ var dep =
+ parseSpec(spec).withConstraint(new VersionConstraint.parse(constraint));
if (dep.name == 'sdk') {
sdkConstraint = dep.constraint;
@@ -1457,17 +1653,19 @@ Package mockPackage(PackageId id, Map dependencyStrings, Map overrides) {
var dependencyOverrides = <PackageDep>[];
if (overrides != null) {
overrides.forEach((spec, constraint) {
- dependencyOverrides.add(parseSpec(spec).withConstraint(
- new VersionConstraint.parse(constraint)));
+ dependencyOverrides.add(
+ parseSpec(spec).withConstraint(new VersionConstraint.parse(constraint)));
});
}
- return new Package.inMemory(new Pubspec(id.name,
- version: id.version,
- dependencies: dependencies,
- devDependencies: devDependencies,
- dependencyOverrides: dependencyOverrides,
- sdkConstraint: sdkConstraint));
+ return new Package.inMemory(
+ new Pubspec(
+ id.name,
+ version: id.version,
+ dependencies: dependencies,
+ devDependencies: devDependencies,
+ dependencyOverrides: dependencyOverrides,
+ sdkConstraint: sdkConstraint));
}
/// Creates a new [PackageId] parsed from [text], which looks something like
@@ -1499,8 +1697,9 @@ PackageId parseSpec(String text, [String version]) {
if (version != null) {
// Spec string shouldn't also contain a version.
if (match[5] != null) {
- throw new ArgumentError("Spec '$text' should not contain a version "
- "since '$version' was passed in explicitly.");
+ throw new ArgumentError(
+ "Spec '$text' should not contain a version "
+ "since '$version' was passed in explicitly.");
}
parsedVersion = new Version.parse(version);
} else {
« no previous file with comments | « sdk/lib/_internal/pub_generated/test/validator/utils.dart ('k') | tests/lib/analyzer/analyze_library.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698