| 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'; |
| 11 import '../../pub/package.dart'; | 11 import '../../pub/package.dart'; |
| 12 import '../../pub/pubspec.dart'; | 12 import '../../pub/pubspec.dart'; |
| 13 import '../../pub/root_source.dart'; | 13 import '../../pub/root_source.dart'; |
| 14 import '../../pub/source.dart'; | 14 import '../../pub/source.dart'; |
| 15 import '../../pub/source_registry.dart'; | 15 import '../../pub/source_registry.dart'; |
| 16 import '../../pub/system_cache.dart'; | 16 import '../../pub/system_cache.dart'; |
| 17 import '../../pub/utils.dart'; | 17 import '../../pub/utils.dart'; |
| 18 import '../../pub/version.dart'; | 18 import '../../pub/version.dart'; |
| 19 import '../../pub/version_solver.dart'; | 19 import '../../pub/version_solver.dart'; |
| 20 import '../../../pkg/unittest/lib/unittest.dart'; | 20 import '../../../pkg/unittest/lib/unittest.dart'; |
| 21 | 21 |
| 22 final noVersion = 'no version'; | 22 final noVersion = 'no version'; |
| 23 final disjointConstraint = 'disjoint'; | 23 final disjointConstraint = 'disjoint'; |
| 24 final sourceMismatch = 'source mismatch'; | 24 final sourceMismatch = 'source mismatch'; |
| 25 final descriptionMismatch = 'description mismatch'; | 25 final descriptionMismatch = 'description mismatch'; |
| 26 final couldNotSolve = 'unsolved'; | 26 final couldNotSolve = 'unsolved'; |
| 27 | 27 |
| 28 Source source1; | 28 MockSource source1; |
| 29 Source source2; | 29 MockSource source2; |
| 30 Source versionlessSource; | 30 Source versionlessSource; |
| 31 Source rootSource; | 31 Source rootSource; |
| 32 | 32 |
| 33 main() { | 33 main() { |
| 34 testResolve('no dependencies', { | 34 testResolve('no dependencies', { |
| 35 'myapp 0.0.0': {} | 35 'myapp 0.0.0': {} |
| 36 }, result: { | 36 }, result: { |
| 37 'myapp from root': '0.0.0' | 37 'myapp from root': '0.0.0' |
| 38 }); | 38 }); |
| 39 | 39 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 var match = new RegExp(r"(.*) from (.*)").firstMatch(name); | 539 var match = new RegExp(r"(.*) from (.*)").firstMatch(name); |
| 540 if (match == null) return new Pair<String, Source>(name, source1); | 540 if (match == null) return new Pair<String, Source>(name, source1); |
| 541 switch (match[2]) { | 541 switch (match[2]) { |
| 542 case 'mock1': return new Pair<String, Source>(match[1], source1); | 542 case 'mock1': return new Pair<String, Source>(match[1], source1); |
| 543 case 'mock2': return new Pair<String, Source>(match[1], source2); | 543 case 'mock2': return new Pair<String, Source>(match[1], source2); |
| 544 case 'root': return new Pair<String, Source>(match[1], rootSource); | 544 case 'root': return new Pair<String, Source>(match[1], rootSource); |
| 545 case 'versionless': | 545 case 'versionless': |
| 546 return new Pair<String, Source>(match[1], versionlessSource); | 546 return new Pair<String, Source>(match[1], versionlessSource); |
| 547 } | 547 } |
| 548 } | 548 } |
| OLD | NEW |