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

Unified Diff: utils/tests/pub/validator_test.dart

Issue 12090081: Add a Pub validator for READMEs that are invalid utf-8. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 11 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 | « utils/tests/pub/test_pub.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/validator_test.dart
diff --git a/utils/tests/pub/validator_test.dart b/utils/tests/pub/validator_test.dart
index cc89c62a75616438f9d8de82603ee78ef542d797..bc4e30e4fa2f6662ff9ed229a460fbcb7ff074e3 100644
--- a/utils/tests/pub/validator_test.dart
+++ b/utils/tests/pub/validator_test.dart
@@ -22,6 +22,7 @@ import '../../pub/validator/lib.dart';
import '../../pub/validator/license.dart';
import '../../pub/validator/name.dart';
import '../../pub/validator/pubspec_field.dart';
+import '../../pub/validator/utf8_readme.dart';
void expectNoValidationError(ValidatorCreator fn) {
expectLater(schedulePackageValidation(fn), pairOf(isEmpty, isEmpty));
@@ -53,6 +54,9 @@ Validator name(Entrypoint entrypoint) => new NameValidator(entrypoint);
Validator pubspecField(Entrypoint entrypoint) =>
new PubspecFieldValidator(entrypoint);
+Validator utf8Readme(Entrypoint entrypoint) =>
+ new Utf8ReadmeValidator(entrypoint);
+
void scheduleNormalPackage() => normalPackage.scheduleCreate();
main() {
@@ -141,6 +145,14 @@ main() {
]).scheduleCreate();
expectNoValidationError(compiledDartdoc);
});
+
+ integration('has a non-primary readme with invalid utf-8', () {
+ dir(appPath, [
+ file("README", "Valid utf-8"),
+ binaryFile("README.invalid", [192])
+ ]).scheduleCreate();
+ expectNoValidationError(utf8Readme);
+ });
});
group('should consider a package invalid if it', () {
@@ -550,5 +562,12 @@ main() {
expectValidationWarning(compiledDartdoc);
});
+
+ test('has a README with invalid utf-8', () {
+ dir(appPath, [
+ binaryFile("README", [192])
+ ]).scheduleCreate();
+ expectValidationWarning(utf8Readme);
+ });
});
}
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698