| 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 check_sdk_test; | 5 library check_sdk_test; |
| 6 | 6 |
| 7 import '../../../pkg/scheduled_test/lib/scheduled_test.dart'; |
| 8 |
| 9 import 'descriptor.dart' as d; |
| 7 import "test_pub.dart"; | 10 import "test_pub.dart"; |
| 8 import "../../../pkg/unittest/lib/unittest.dart"; | |
| 9 | 11 |
| 10 main() { | 12 main() { |
| 11 initConfig(); | 13 initConfig(); |
| 12 | 14 |
| 13 for (var command in ["install", "update"]) { | 15 for (var command in ["install", "update"]) { |
| 14 var success = new RegExp(r"Dependencies installed!$"); | 16 var success = new RegExp(r"Dependencies installed!$"); |
| 15 if (command == "update") { | 17 if (command == "update") { |
| 16 success = new RegExp(r"Dependencies updated!$"); | 18 success = new RegExp(r"Dependencies updated!$"); |
| 17 } | 19 } |
| 18 | 20 |
| 19 integration("gives a friendly message if there are no constraints", () { | 21 integration("gives a friendly message if there are no constraints", () { |
| 20 dir(appPath, [ | 22 d.dir(appPath, [ |
| 21 pubspec({"name": "myapp"}), | 23 d.pubspec({"name": "myapp"}), |
| 22 ]).scheduleCreate(); | 24 ]).create(); |
| 23 | 25 |
| 24 schedulePub(args: [command], output: success); | 26 schedulePub(args: [command], output: success); |
| 25 }); | 27 }); |
| 26 | 28 |
| 27 integration("gives an error if the root package does not match", () { | 29 integration("gives an error if the root package does not match", () { |
| 28 dir(appPath, [ | 30 d.dir(appPath, [ |
| 29 pubspec({ | 31 d.pubspec({ |
| 30 "name": "myapp", | 32 "name": "myapp", |
| 31 "environment": {"sdk": ">2.0.0"} | 33 "environment": {"sdk": ">2.0.0"} |
| 32 }) | 34 }) |
| 33 ]).scheduleCreate(); | 35 ]).create(); |
| 34 | 36 |
| 35 schedulePub(args: [command], | 37 schedulePub(args: [command], |
| 36 error: | 38 error: |
| 37 """ | 39 """ |
| 38 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: | 40 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: |
| 39 - 'myapp' requires >2.0.0 | 41 - 'myapp' requires >2.0.0 |
| 40 | 42 |
| 41 You may be able to resolve this by upgrading to the latest Dart SDK | 43 You may be able to resolve this by upgrading to the latest Dart SDK |
| 42 or adding a version constraint to use an older version of a package. | 44 or adding a version constraint to use an older version of a package. |
| 43 """); | 45 """); |
| 44 }); | 46 }); |
| 45 | 47 |
| 46 integration("gives an error if some dependencies do not match", () { | 48 integration("gives an error if some dependencies do not match", () { |
| 47 // Using a path source, but this should be true of all sources. | 49 // Using a path source, but this should be true of all sources. |
| 48 dir("foo", [ | 50 d.dir("foo", [ |
| 49 libPubspec("foo", "0.0.1", sdk: ">0.1.3"), | 51 d.libPubspec("foo", "0.0.1", sdk: ">0.1.3"), |
| 50 libDir("foo") | 52 d.libDir("foo") |
| 51 ]).scheduleCreate(); | 53 ]).create(); |
| 52 dir("bar", [ | 54 d.dir("bar", [ |
| 53 libPubspec("bar", "0.0.1", sdk: ">0.1.1"), | 55 d.libPubspec("bar", "0.0.1", sdk: ">0.1.1"), |
| 54 libDir("bar") | 56 d.libDir("bar") |
| 55 ]).scheduleCreate(); | 57 ]).create(); |
| 56 | 58 |
| 57 dir(appPath, [ | 59 d.dir(appPath, [ |
| 58 pubspec({ | 60 d.pubspec({ |
| 59 "name": "myapp", | 61 "name": "myapp", |
| 60 "dependencies": { | 62 "dependencies": { |
| 61 "foo": {"path": "../foo"}, | 63 "foo": {"path": "../foo"}, |
| 62 "bar": {"path": "../bar"} | 64 "bar": {"path": "../bar"} |
| 63 }, | 65 }, |
| 64 "environment": {"sdk": ">2.0.0"} | 66 "environment": {"sdk": ">2.0.0"} |
| 65 }) | 67 }) |
| 66 ]).scheduleCreate(); | 68 ]).create(); |
| 67 | 69 |
| 68 schedulePub(args: [command], | 70 schedulePub(args: [command], |
| 69 error: | 71 error: |
| 70 """ | 72 """ |
| 71 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: | 73 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: |
| 72 - 'myapp' requires >2.0.0 | 74 - 'myapp' requires >2.0.0 |
| 73 - 'foo' requires >0.1.3 | 75 - 'foo' requires >0.1.3 |
| 74 | 76 |
| 75 You may be able to resolve this by upgrading to the latest Dart SDK | 77 You may be able to resolve this by upgrading to the latest Dart SDK |
| 76 or adding a version constraint to use an older version of a package. | 78 or adding a version constraint to use an older version of a package. |
| 77 """); | 79 """); |
| 78 }); | 80 }); |
| 79 | 81 |
| 80 integration("gives an error if a transitive dependency doesn't match", () { | 82 integration("gives an error if a transitive dependency doesn't match", () { |
| 81 // Using a path source, but this should be true of all sources. | 83 // Using a path source, but this should be true of all sources. |
| 82 dir("foo", [ | 84 d.dir("foo", [ |
| 83 libPubspec("foo", "0.0.1", deps: [ | 85 d.libPubspec("foo", "0.0.1", deps: [ |
| 84 {"path": "../bar"} | 86 {"path": "../bar"} |
| 85 ]), | 87 ]), |
| 86 libDir("foo") | 88 d.libDir("foo") |
| 87 ]).scheduleCreate(); | 89 ]).create(); |
| 88 dir("bar", [ | 90 d.dir("bar", [ |
| 89 libPubspec("bar", "0.0.1", sdk: "<0.1.1"), | 91 d.libPubspec("bar", "0.0.1", sdk: "<0.1.1"), |
| 90 libDir("bar") | 92 d.libDir("bar") |
| 91 ]).scheduleCreate(); | 93 ]).create(); |
| 92 | 94 |
| 93 dir(appPath, [ | 95 d.dir(appPath, [ |
| 94 pubspec({ | 96 d.pubspec({ |
| 95 "name": "myapp", | 97 "name": "myapp", |
| 96 "dependencies": { | 98 "dependencies": { |
| 97 "foo": {"path": "../foo"} | 99 "foo": {"path": "../foo"} |
| 98 } | 100 } |
| 99 }) | 101 }) |
| 100 ]).scheduleCreate(); | 102 ]).create(); |
| 101 | 103 |
| 102 schedulePub(args: [command], | 104 schedulePub(args: [command], |
| 103 error: | 105 error: |
| 104 """ | 106 """ |
| 105 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: | 107 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: |
| 106 - 'bar' requires <0.1.1 | 108 - 'bar' requires <0.1.1 |
| 107 | 109 |
| 108 You may be able to resolve this by upgrading to the latest Dart SDK | 110 You may be able to resolve this by upgrading to the latest Dart SDK |
| 109 or adding a version constraint to use an older version of a package. | 111 or adding a version constraint to use an older version of a package. |
| 110 """); | 112 """); |
| 111 }); | 113 }); |
| 112 | 114 |
| 113 integration("handles a circular dependency on the root package", () { | 115 integration("handles a circular dependency on the root package", () { |
| 114 // Using a path source, but this should be true of all sources. | 116 // Using a path source, but this should be true of all sources. |
| 115 dir("foo", [ | 117 d.dir("foo", [ |
| 116 libPubspec("foo", "0.0.1", sdk: ">3.0.0", deps: [ | 118 d.libPubspec("foo", "0.0.1", sdk: ">3.0.0", deps: [ |
| 117 {"path": "../myapp"} | 119 {"path": "../myapp"} |
| 118 ]), | 120 ]), |
| 119 libDir("foo") | 121 d.libDir("foo") |
| 120 ]).scheduleCreate(); | 122 ]).create(); |
| 121 | 123 |
| 122 dir(appPath, [ | 124 d.dir(appPath, [ |
| 123 pubspec({ | 125 d.pubspec({ |
| 124 "name": "myapp", | 126 "name": "myapp", |
| 125 "dependencies": { | 127 "dependencies": { |
| 126 "foo": {"path": "../foo"} | 128 "foo": {"path": "../foo"} |
| 127 }, | 129 }, |
| 128 "environment": {"sdk": ">2.0.0"} | 130 "environment": {"sdk": ">2.0.0"} |
| 129 }) | 131 }) |
| 130 ]).scheduleCreate(); | 132 ]).create(); |
| 131 | 133 |
| 132 schedulePub(args: [command], | 134 schedulePub(args: [command], |
| 133 error: | 135 error: |
| 134 """ | 136 """ |
| 135 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: | 137 Some packages that were installed are not compatible with your SDK v
ersion 0.1.2+3 and may not work: |
| 136 - 'myapp' requires >2.0.0 | 138 - 'myapp' requires >2.0.0 |
| 137 - 'foo' requires >3.0.0 | 139 - 'foo' requires >3.0.0 |
| 138 | 140 |
| 139 You may be able to resolve this by upgrading to the latest Dart SDK | 141 You may be able to resolve this by upgrading to the latest Dart SDK |
| 140 or adding a version constraint to use an older version of a package. | 142 or adding a version constraint to use an older version of a package. |
| 141 """); | 143 """); |
| 142 }); | 144 }); |
| 143 } | 145 } |
| 144 } | 146 } |
| OLD | NEW |