OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'descriptor.dart' as d; | 5 import 'descriptor.dart' as d; |
6 import 'test_pub.dart'; | 6 import 'test_pub.dart'; |
7 import '../lib/src/barback.dart' as barback; | 7 import '../lib/src/barback.dart' as barback; |
8 import '../lib/src/version.dart'; | 8 import '../lib/src/version.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 initConfig(); | 11 initConfig(); |
12 | 12 |
13 var current = barback.supportedVersion.toString(); | 13 var current = barback.supportedVersions.min.toString(); |
14 var previous = new Version(barback.supportedVersion.major, | 14 var previous = new Version(barback.supportedVersions.min.major, |
15 barback.supportedVersion.minor - 1, 0).toString(); | 15 barback.supportedVersions.min.minor - 1, 0).toString(); |
16 var nextPatch = barback.supportedVersion.nextPatch.toString(); | 16 var nextPatch = barback.supportedVersions.min.nextPatch.toString(); |
17 var max = barback.supportedVersion.nextMinor.toString(); | 17 var max = barback.supportedVersions.max.toString(); |
18 | 18 |
19 forBothPubGetAndUpgrade((command) { | 19 forBothPubGetAndUpgrade((command) { |
20 integration("implicitly constrains barback to versions pub supports", () { | 20 integration("implicitly constrains barback to versions pub supports", () { |
21 servePackages([ | 21 servePackages([ |
22 packageMap("barback", previous), | 22 packageMap("barback", previous), |
23 packageMap("barback", current), | 23 packageMap("barback", current), |
24 packageMap("barback", nextPatch), | 24 packageMap("barback", nextPatch), |
25 packageMap("barback", max) | 25 packageMap("barback", max) |
26 ]); | 26 ]); |
27 | 27 |
28 d.appDir({ | 28 d.appDir({ |
29 "barback": "any" | 29 "barback": "any" |
30 }).create(); | 30 }).create(); |
31 | 31 |
32 pubCommand(command); | 32 pubCommand(command); |
33 | 33 |
34 d.packagesDir({ | 34 d.packagesDir({ |
35 "barback": barback.supportedVersion.nextPatch.toString() | 35 "barback": barback.supportedVersions.min.nextPatch.toString() |
36 }).validate(); | 36 }).validate(); |
37 }); | 37 }); |
38 | 38 |
39 integration("discovers transitive dependency on barback", () { | 39 integration("discovers transitive dependency on barback", () { |
40 servePackages([ | 40 servePackages([ |
41 packageMap("barback", previous), | 41 packageMap("barback", previous), |
42 packageMap("barback", current), | 42 packageMap("barback", current), |
43 packageMap("barback", nextPatch), | 43 packageMap("barback", nextPatch), |
44 packageMap("barback", max) | 44 packageMap("barback", max) |
45 ]); | 45 ]); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ]); | 126 ]); |
127 | 127 |
128 d.appDir({"barback": previous}).create(); | 128 d.appDir({"barback": previous}).create(); |
129 | 129 |
130 pubGet(error: """ | 130 pubGet(error: """ |
131 Incompatible version constraints on barback: | 131 Incompatible version constraints on barback: |
132 - myapp depends on version $previous | 132 - myapp depends on version $previous |
133 - pub itself depends on version >=$current <$max"""); | 133 - pub itself depends on version >=$current <$max"""); |
134 }); | 134 }); |
135 } | 135 } |
OLD | NEW |