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

Unified Diff: test/version_solver_test.dart

Issue 1459733002: Move pubspec caching into each source. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 1 month 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 | « lib/src/validator/dependency.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/version_solver_test.dart
diff --git a/test/version_solver_test.dart b/test/version_solver_test.dart
index 1ddacafc1f8c719dd66a62b70ecf9bae9d310d24..5239bf6bf060bca1cfc6864838405e61990083af 100644
--- a/test/version_solver_test.dart
+++ b/test/version_solver_test.dart
@@ -1395,24 +1395,22 @@ class MockSource extends CachedSource {
String getDirectory(PackageId id) => '${id.name}-${id.version}';
- Future<List<Pubspec>> getVersions(String name, String description) {
- 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.');
- }
+ Future<List<PackageId>> doGetVersions(PackageRef ref) async {
+ // Make sure the solver doesn't request the same thing twice.
+ if (_requestedVersions.contains(ref.description)) {
+ throw new Exception('Version list for $description was already '
+ 'requested.');
+ }
- _requestedVersions.add(description);
+ _requestedVersions.add(ref.description);
- if (!_packages.containsKey(description)){
- throw new Exception('MockSource does not have a package matching '
- '"$description".');
- }
+ if (!_packages.containsKey(ref.description)){
+ throw new Exception('MockSource does not have a package matching '
+ '"${ref.description}".');
+ }
- return _packages[description].values
- .map((package) => package.pubspec).toList();
- });
+ return _packages[ref.description].values
+ .map((package) => ref.atVersion(package.version)).toList();
}
Future<Pubspec> describeUncached(PackageId id) {
« no previous file with comments | « lib/src/validator/dependency.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698