OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 library pub_tests; |
| 6 |
| 7 import 'package:scheduled_test/scheduled_test.dart'; |
| 8 |
| 9 import '../descriptor.dart' as d; |
| 10 import '../test_pub.dart'; |
| 11 |
| 12 main() { |
| 13 initConfig(); |
| 14 integration("downgrades a dependency to the lowest matching version", () { |
| 15 servePackages([ |
| 16 packageMap("foo", "1.0.0"), |
| 17 packageMap("foo", "2.0.0-dev"), |
| 18 packageMap("foo", "2.0.0"), |
| 19 packageMap("foo", "2.1.0"), |
| 20 ]); |
| 21 |
| 22 d.appDir({"foo": ">=2.0.0 <3.0.0"}).create(); |
| 23 |
| 24 pubGet(); |
| 25 |
| 26 d.packagesDir({ |
| 27 "foo": "2.1.0", |
| 28 }).validate(); |
| 29 |
| 30 pubDowngrade(); |
| 31 |
| 32 // 1.0.0 shouldn't be chosen because it's outside the version constraint and |
| 33 // 2.0.0-dev shouldn't be chosen because release versions should be |
| 34 // preferred. |
| 35 d.packagesDir({ |
| 36 "foo": "2.0.0", |
| 37 }).validate(); |
| 38 |
| 39 // The lockfile should be updated. |
| 40 d.dir(appPath, [ |
| 41 d.matcherFile("pubspec.lock", contains("2.0.0")) |
| 42 ]).validate(); |
| 43 }); |
| 44 } |
OLD | NEW |