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