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