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

Side by Side Diff: utils/tests/pub/version_solver_test.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | utils/tests/pub/yaml_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub_update_test; 5 library pub_update_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 import '../../pub/lock_file.dart'; 10 import '../../pub/lock_file.dart';
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 class MockSource extends Source { 442 class MockSource extends Source {
443 final Map<String, Map<Version, Package>> _packages; 443 final Map<String, Map<Version, Package>> _packages;
444 444
445 final String name; 445 final String name;
446 bool get shouldCache => true; 446 bool get shouldCache => true;
447 447
448 MockSource(this.name) 448 MockSource(this.name)
449 : _packages = <String, Map<Version, Package>>{}; 449 : _packages = <String, Map<Version, Package>>{};
450 450
451 Future<List<Version>> getVersions(String name, String description) { 451 Future<List<Version>> getVersions(String name, String description) {
452 return fakeAsync(() => _packages[description].getKeys()); 452 return fakeAsync(() => _packages[description].keys);
453 } 453 }
454 454
455 Future<Pubspec> describe(PackageId id) { 455 Future<Pubspec> describe(PackageId id) {
456 return fakeAsync(() { 456 return fakeAsync(() {
457 return _packages[id.name][id.version].pubspec; 457 return _packages[id.name][id.version].pubspec;
458 }); 458 });
459 } 459 }
460 460
461 Future<bool> install(PackageId id, String path) { 461 Future<bool> install(PackageId id, String path) {
462 throw 'no'; 462 throw 'no';
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 var match = new RegExp(r"(.*) from (.*)").firstMatch(name); 524 var match = new RegExp(r"(.*) from (.*)").firstMatch(name);
525 if (match == null) return new Pair<String, Source>(name, source1); 525 if (match == null) return new Pair<String, Source>(name, source1);
526 switch (match[2]) { 526 switch (match[2]) {
527 case 'mock1': return new Pair<String, Source>(match[1], source1); 527 case 'mock1': return new Pair<String, Source>(match[1], source1);
528 case 'mock2': return new Pair<String, Source>(match[1], source2); 528 case 'mock2': return new Pair<String, Source>(match[1], source2);
529 case 'root': return new Pair<String, Source>(match[1], rootSource); 529 case 'root': return new Pair<String, Source>(match[1], rootSource);
530 case 'versionless': 530 case 'versionless':
531 return new Pair<String, Source>(match[1], versionlessSource); 531 return new Pair<String, Source>(match[1], versionlessSource);
532 } 532 }
533 } 533 }
OLDNEW
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | utils/tests/pub/yaml_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698