Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart

Issue 686323002: Add support for ^ constraints in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
diff --git a/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart b/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
index 5f05d3d1b65d4455bc4119a4581bd55db2bee1ad..689fc66130cc7950ca248448f7b75e9767ba7b7e 100644
--- a/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/validator/dependency_test.dart
@@ -59,9 +59,18 @@ setUpDependency(Map dep, {List<String> hostedVersions}) {
main() {
initConfig();
- integration('should consider a package valid if it looks normal', () {
- d.validPackage.create();
- expectNoValidationError(dependency);
+ group('should consider a package valid if it', () {
+ integration('looks normal', () {
+ d.validPackage.create();
+ expectNoValidationError(dependency);
+ });
+
+ integration('has a ^ constraint with an appropriate SDK constraint', () {
+ d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: {
+ "foo": "^1.2.3"
+ }, sdk: ">=1.8.0 <2.0.0")]).create();
+ expectNoValidationError(dependency);
+ });
});
group('should consider a package invalid if it', () {
@@ -380,5 +389,23 @@ main() {
expectDependencyValidationWarning(' foo: ">1.2.3 <2.0.0"');
});
});
+
+ group('has a ^ dependency', () {
+ integration("without an SDK constraint", () {
+ d.dir(appPath, [d.libPubspec("integration_pkg", "1.0.0", deps: {
+ "foo": "^1.2.3"
+ })]).create();
+
+ expectDependencyValidationError(' foo: ">=1.2.3 <2.0.0"');
+ });
+
+ integration("with a too-broad SDK constraint", () {
+ d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0", deps: {
+ "foo": "^1.2.3"
+ }, sdk: ">=1.5.0 <2.0.0")]).create();
+
+ expectDependencyValidationError(' foo: ">=1.2.3 <2.0.0"');
+ });
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698