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/source.dart'); | 13 #import('../../pub/source.dart'); |
14 #import('../../pub/source_registry.dart'); | 14 #import('../../pub/source_registry.dart'); |
15 #import('../../pub/utils.dart'); | 15 #import('../../pub/utils.dart'); |
16 #import('../../pub/version.dart'); | 16 #import('../../pub/version.dart'); |
17 #import('../../pub/version_solver.dart'); | 17 #import('../../pub/version_solver.dart'); |
18 #import('../../../lib/unittest/unittest.dart'); | 18 #import('../../../pkg/unittest/unittest.dart'); |
19 | 19 |
20 final noVersion = 'no version'; | 20 final noVersion = 'no version'; |
21 final disjointConstraint = 'disjoint'; | 21 final disjointConstraint = 'disjoint'; |
22 final sourceMismatch = 'source mismatch'; | 22 final sourceMismatch = 'source mismatch'; |
23 final descriptionMismatch = 'description mismatch'; | 23 final descriptionMismatch = 'description mismatch'; |
24 final couldNotSolve = 'unsolved'; | 24 final couldNotSolve = 'unsolved'; |
25 | 25 |
26 Source source1; | 26 Source source1; |
27 Source source2; | 27 Source source2; |
28 Source versionlessSource; | 28 Source versionlessSource; |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 Pair<String, Source> parseSource(String name) { | 458 Pair<String, Source> parseSource(String name) { |
459 var match = new RegExp(@"(.*) from (.*)").firstMatch(name); | 459 var match = new RegExp(@"(.*) from (.*)").firstMatch(name); |
460 if (match == null) return new Pair<String, Source>(name, source1); | 460 if (match == null) return new Pair<String, Source>(name, source1); |
461 switch (match[2]) { | 461 switch (match[2]) { |
462 case 'mock1': return new Pair<String, Source>(match[1], source1); | 462 case 'mock1': return new Pair<String, Source>(match[1], source1); |
463 case 'mock2': return new Pair<String, Source>(match[1], source2); | 463 case 'mock2': return new Pair<String, Source>(match[1], source2); |
464 case 'versionless': | 464 case 'versionless': |
465 return new Pair<String, Source>(match[1], versionlessSource); | 465 return new Pair<String, Source>(match[1], versionlessSource); |
466 } | 466 } |
467 } | 467 } |
OLD | NEW |