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

Unified Diff: sdk/lib/_internal/pub/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/test/validator/dependency_test.dart
diff --git a/sdk/lib/_internal/pub/test/validator/dependency_test.dart b/sdk/lib/_internal/pub/test/validator/dependency_test.dart
index 8c53c744c9ef64482df360a1ac31579661b12f85..dd301294c0dce744463a2fa28063ab0a6e51f4f3 100644
--- a/sdk/lib/_internal/pub/test/validator/dependency_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/dependency_test.dart
@@ -57,9 +57,20 @@ 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 +391,27 @@ 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