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

Side by Side Diff: test/version_solver_test.dart

Issue 1276673006: Make Source.getDirectory synchronous. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « test/pubspec_test.dart ('k') | no next file » | 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_upgrade_test; 5 library pub_upgrade_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:pub/src/lock_file.dart'; 9 import 'package:pub/src/lock_file.dart';
10 import 'package:pub/src/log.dart' as log; 10 import 'package:pub/src/log.dart' as log;
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 final hasMultipleVersions = true; 1385 final hasMultipleVersions = true;
1386 1386
1387 MockSource(this.name); 1387 MockSource(this.name);
1388 1388
1389 dynamic parseDescription(String containingPath, description, 1389 dynamic parseDescription(String containingPath, description,
1390 {bool fromLockFile: false}) => description; 1390 {bool fromLockFile: false}) => description;
1391 1391
1392 bool descriptionsEqual(description1, description2) => 1392 bool descriptionsEqual(description1, description2) =>
1393 description1 == description2; 1393 description1 == description2;
1394 1394
1395 Future<String> getDirectory(PackageId id) { 1395 String getDirectory(PackageId id) => '${id.name}-${id.version}';
1396 return new Future.value('${id.name}-${id.version}');
1397 }
1398 1396
1399 Future<List<Pubspec>> getVersions(String name, String description) { 1397 Future<List<Pubspec>> getVersions(String name, String description) {
1400 return new Future.sync(() { 1398 return new Future.sync(() {
1401 // Make sure the solver doesn't request the same thing twice. 1399 // Make sure the solver doesn't request the same thing twice.
1402 if (_requestedVersions.contains(description)) { 1400 if (_requestedVersions.contains(description)) {
1403 throw new Exception('Version list for $description was already ' 1401 throw new Exception('Version list for $description was already '
1404 'requested.'); 1402 'requested.');
1405 } 1403 }
1406 1404
1407 _requestedVersions.add(description); 1405 _requestedVersions.add(description);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 } 1530 }
1533 1531
1534 var source = "mock1"; 1532 var source = "mock1";
1535 if (match[7] != null) { 1533 if (match[7] != null) {
1536 source = match[7]; 1534 source = match[7];
1537 if (source == "root") source = null; 1535 if (source == "root") source = null;
1538 } 1536 }
1539 1537
1540 return new PackageId(name, source, parsedVersion, description); 1538 return new PackageId(name, source, parsedVersion, description);
1541 } 1539 }
OLDNEW
« no previous file with comments | « test/pubspec_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698