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

Unified Diff: test/validator/sdk_constraint_test.dart

Issue 2172883002: Add validation for Flutter constraints. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 5 months 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
« no previous file with comments | « lib/src/validator/sdk_constraint.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/validator/sdk_constraint_test.dart
diff --git a/test/validator/sdk_constraint_test.dart b/test/validator/sdk_constraint_test.dart
index ce09d7110133295432f023d7964a619b55a098cc..ace760bc6777731545bd363bdf00943d625968da 100644
--- a/test/validator/sdk_constraint_test.dart
+++ b/test/validator/sdk_constraint_test.dart
@@ -27,14 +27,68 @@ main() {
]).create();
expectNoValidationError(sdkConstraint);
});
+
+ integration('has a Flutter SDK constraint with an appropriate Dart SDK '
+ 'constraint', () {
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "test_pkg",
+ "version": "1.0.0",
+ "environment": {
+ "sdk": ">=1.19.0 <2.0.0",
+ "flutter": "^1.2.3"
+ }
+ })
+ ]).create();
+ expectNoValidationError(sdkConstraint);
+ });
});
- test("should consider a package invalid if it has an SDK constraint with "
- "^", () {
- d.dir(appPath, [
- d.libPubspec("test_pkg", "1.0.0", sdk: "^1.8.0")
- ]).create();
- expect(schedulePackageValidation(sdkConstraint),
- completion(pairOf(anyElement(contains('">=1.8.0 <2.0.0"')), isEmpty)));
+ group("should consider a package invalid if it", () {
+ integration("has an SDK constraint with ^", () {
+ d.dir(appPath, [
+ d.libPubspec("test_pkg", "1.0.0", sdk: "^1.8.0")
+ ]).create();
+ expect(
+ schedulePackageValidation(sdkConstraint),
+ completion(pairOf(
+ anyElement(contains('">=1.8.0 <2.0.0"')),
+ isEmpty)));
+ });
+
+ integration("has a Flutter SDK constraint with a too-broad SDK "
+ "constraint", () {
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "test_pkg",
+ "version": "1.0.0",
+ "environment": {
+ "sdk": ">=1.18.0 <1.50.0",
+ "flutter": "^1.2.3"
+ }
+ })
+ ]).create();
+ expect(
+ schedulePackageValidation(sdkConstraint),
+ completion(pairOf(
+ anyElement(contains('">=1.19.0 <1.50.0"')),
+ isEmpty)));
+ });
+
+ integration("has a Flutter SDK constraint with no SDK "
+ "constraint", () {
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "test_pkg",
+ "version": "1.0.0",
+ "environment": {"flutter": "^1.2.3"}
+ })
+ ]).create();
+ expect(
+ schedulePackageValidation(sdkConstraint),
+ completion(pairOf(
+ anyElement(contains('">=1.19.0 <2.0.0"')),
+ isEmpty)));
+ });
});
}
« no previous file with comments | « lib/src/validator/sdk_constraint.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698