OLD | NEW |
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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // Resolve the versions. | 397 // Resolve the versions. |
398 var future = resolveVersions(sources, root, realLockFile); | 398 var future = resolveVersions(sources, root, realLockFile); |
399 | 399 |
400 if (result != null) { | 400 if (result != null) { |
401 expect(future, completion(predicate((actualResult) { | 401 expect(future, completion(predicate((actualResult) { |
402 for (var actualId in actualResult) { | 402 for (var actualId in actualResult) { |
403 if (!result.containsKey(actualId.name)) return false; | 403 if (!result.containsKey(actualId.name)) return false; |
404 var expectedId = result.remove(actualId.name); | 404 var expectedId = result.remove(actualId.name); |
405 if (actualId != expectedId) return false; | 405 if (actualId != expectedId) return false; |
406 } | 406 } |
407 return result.isEmpty(); | 407 return result.isEmpty; |
408 }, description: 'packages to match $result'))); | 408 }, description: 'packages to match $result'))); |
409 } else if (error == noVersion) { | 409 } else if (error == noVersion) { |
410 expect(future, throwsA(new isInstanceOf<NoVersionException>())); | 410 expect(future, throwsA(new isInstanceOf<NoVersionException>())); |
411 } else if (error == disjointConstraint) { | 411 } else if (error == disjointConstraint) { |
412 expect(future, throwsA(new isInstanceOf<DisjointConstraintException>())); | 412 expect(future, throwsA(new isInstanceOf<DisjointConstraintException>())); |
413 } else if (error == sourceMismatch) { | 413 } else if (error == sourceMismatch) { |
414 expect(future, throwsA(new isInstanceOf<SourceMismatchException>())); | 414 expect(future, throwsA(new isInstanceOf<SourceMismatchException>())); |
415 } else if (error == descriptionMismatch) { | 415 } else if (error == descriptionMismatch) { |
416 expect(future, throwsA(new isInstanceOf<DescriptionMismatchException>())); | 416 expect(future, throwsA(new isInstanceOf<DescriptionMismatchException>())); |
417 } else if (error == couldNotSolve) { | 417 } else if (error == couldNotSolve) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |