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))); |
+ }); |
}); |
} |