| Index: sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart b/sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
|
| index 15ed04e2ecd7715ba8fd761cbf3cc069d7ca4201..9c951a887eaee58284033296826a1ed455c0b900 100644
|
| --- a/sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
|
| +++ b/sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
|
| @@ -28,6 +28,22 @@ main() {
|
| d.dir(appPath, [d.pubspec(pkg)]).create();
|
| expectNoValidationError(pubspecField);
|
| });
|
| +
|
| + integration('has an HTTPS homepage URL', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["homepage"] = "https://pub.dartlang.org";
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectNoValidationError(pubspecField);
|
| + });
|
| +
|
| + integration('has an HTTPS documentation URL', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["documentation"] = "https://pub.dartlang.org";
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectNoValidationError(pubspecField);
|
| + });
|
| });
|
|
|
| group('should consider a package invalid if it', () {
|
| @@ -57,6 +73,46 @@ main() {
|
| expectValidationError(pubspecField);
|
| });
|
|
|
| + integration('has a non-string "homepage" field', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["homepage"] = 12;
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| +
|
| + integration('has a non-string "description" field', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["description"] = 12;
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| +
|
| + integration('has a non-string "author" field', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["author"] = 12;
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| +
|
| + integration('has a non-list "authors" field', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["authors"] = 12;
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| +
|
| + integration('has a non-string member of the "authors" field', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["authors"] = [12];
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| +
|
| integration('has a single author without an email', () {
|
| var pkg = packageMap("test_pkg", "1.0.0");
|
| pkg["author"] = "Nathan Weizenbaum";
|
| @@ -98,5 +154,21 @@ main() {
|
|
|
| expectValidationWarning(pubspecField);
|
| });
|
| +
|
| + integration('has a non-HTTP homepage URL', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["homepage"] = "file:///foo/bar";
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| +
|
| + integration('has a non-HTTP documentation URL', () {
|
| + var pkg = packageMap("test_pkg", "1.0.0");
|
| + pkg["documentation"] = "file:///foo/bar";
|
| + d.dir(appPath, [d.pubspec(pkg)]).create();
|
| +
|
| + expectValidationError(pubspecField);
|
| + });
|
| });
|
| }
|
|
|