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

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: 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
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..91cd78492d6f794d2cc26ba712ca3e184f914e74 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', () {
@@ -98,5 +114,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);
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698