| 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_upgrade_test; | 5 library pub_upgrade_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:pub_semver/pub_semver.dart'; | 9 import 'package:pub_semver/pub_semver.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 'bar': '1.0.0' | 132 'bar': '1.0.0' |
| 133 }, | 133 }, |
| 134 'bar 1.0.0': { | 134 'bar 1.0.0': { |
| 135 'foo': '1.0.0' | 135 'foo': '1.0.0' |
| 136 } | 136 } |
| 137 }, result: { | 137 }, result: { |
| 138 'myapp from root': '1.0.0', | 138 'myapp from root': '1.0.0', |
| 139 'foo': '1.0.0', | 139 'foo': '1.0.0', |
| 140 'bar': '1.0.0' | 140 'bar': '1.0.0' |
| 141 }); | 141 }); |
| 142 |
| 143 testResolve('removed dependency', { |
| 144 'myapp 1.0.0': { |
| 145 'foo': '1.0.0', |
| 146 'bar': 'any' |
| 147 }, |
| 148 'foo 1.0.0': {}, |
| 149 'foo 2.0.0': {}, |
| 150 'bar 1.0.0': {}, |
| 151 'bar 2.0.0': { |
| 152 'baz': '1.0.0' |
| 153 }, |
| 154 'baz 1.0.0': { |
| 155 'foo': '2.0.0' |
| 156 } |
| 157 }, result: { |
| 158 'myapp from root': '1.0.0', |
| 159 'foo': '1.0.0', |
| 160 'bar': '1.0.0' |
| 161 }, maxTries: 2); |
| 142 } | 162 } |
| 143 | 163 |
| 144 withLockFile() { | 164 withLockFile() { |
| 145 testResolve('with compatible locked dependency', { | 165 testResolve('with compatible locked dependency', { |
| 146 'myapp 0.0.0': { | 166 'myapp 0.0.0': { |
| 147 'foo': 'any' | 167 'foo': 'any' |
| 148 }, | 168 }, |
| 149 'foo 1.0.0': { 'bar': '1.0.0' }, | 169 'foo 1.0.0': { 'bar': '1.0.0' }, |
| 150 'foo 1.0.1': { 'bar': '1.0.1' }, | 170 'foo 1.0.1': { 'bar': '1.0.1' }, |
| 151 'foo 1.0.2': { 'bar': '1.0.2' }, | 171 'foo 1.0.2': { 'bar': '1.0.2' }, |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 "collection": ">=0.9.1 <1.0.0" | 452 "collection": ">=0.9.1 <1.0.0" |
| 433 }, | 453 }, |
| 434 "angular 0.9.10": { | 454 "angular 0.9.10": { |
| 435 "di": ">=0.0.32 <0.1.0", | 455 "di": ">=0.0.32 <0.1.0", |
| 436 "collection": ">=0.9.1 <1.0.0" | 456 "collection": ">=0.9.1 <1.0.0" |
| 437 }, | 457 }, |
| 438 "collection 0.9.0": {}, | 458 "collection 0.9.0": {}, |
| 439 "collection 0.9.1": {}, | 459 "collection 0.9.1": {}, |
| 440 "di 0.0.37": {"analyzer": ">=0.13.0 <0.14.0"}, | 460 "di 0.0.37": {"analyzer": ">=0.13.0 <0.14.0"}, |
| 441 "di 0.0.36": {"analyzer": ">=0.13.0 <0.14.0"} | 461 "di 0.0.36": {"analyzer": ">=0.13.0 <0.14.0"} |
| 442 }, error: noVersion(['myapp', 'angular', 'collection']), maxTries: 9); | 462 }, error: noVersion(['analyzer', 'di']), maxTries: 9); |
| 443 } | 463 } |
| 444 | 464 |
| 445 badSource() { | 465 badSource() { |
| 446 testResolve('fail if the root package has a bad source in dep', { | 466 testResolve('fail if the root package has a bad source in dep', { |
| 447 'myapp 0.0.0': { | 467 'myapp 0.0.0': { |
| 448 'foo from bad': 'any' | 468 'foo from bad': 'any' |
| 449 }, | 469 }, |
| 450 }, error: unknownSource('myapp', 'foo', 'bad')); | 470 }, error: unknownSource('myapp', 'foo', 'bad')); |
| 451 | 471 |
| 452 testResolve('fail if the root package has a bad source in dev dep', { | 472 testResolve('fail if the root package has a bad source in dev dep', { |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1513 } | 1533 } |
| 1514 | 1534 |
| 1515 var source = "mock1"; | 1535 var source = "mock1"; |
| 1516 if (match[7] != null) { | 1536 if (match[7] != null) { |
| 1517 source = match[7]; | 1537 source = match[7]; |
| 1518 if (source == "root") source = null; | 1538 if (source == "root") source = null; |
| 1519 } | 1539 } |
| 1520 | 1540 |
| 1521 return new PackageId(name, source, parsedVersion, description); | 1541 return new PackageId(name, source, parsedVersion, description); |
| 1522 } | 1542 } |
| OLD | NEW |