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

Unified Diff: sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart

Issue 24246002: Lazily throw pubspec parsing exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 3 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 | « sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ });
});
}
« no previous file with comments | « sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698