| Index: utils/tests/pub/validator_test.dart
|
| diff --git a/utils/tests/pub/validator_test.dart b/utils/tests/pub/validator_test.dart
|
| index 75b51ff010b66366d3ab7e4b231653196d25fc96..2a26a52266e49866bf374e959443038c9c64ac79 100644
|
| --- a/utils/tests/pub/validator_test.dart
|
| +++ b/utils/tests/pub/validator_test.dart
|
| @@ -21,6 +21,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));
|
| @@ -49,6 +50,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() {
|
| @@ -125,6 +129,14 @@ main() {
|
| ]).scheduleCreate();
|
| expectNoValidationError(directory);
|
| });
|
| +
|
| + 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', () {
|
| @@ -520,5 +532,12 @@ main() {
|
| });
|
| }
|
| });
|
| +
|
| + test('has a README with invalid utf-8', () {
|
| + dir(appPath, [
|
| + binaryFile("README", [192])
|
| + ]).scheduleCreate();
|
| + expectValidationWarning(utf8Readme);
|
| + });
|
| });
|
| }
|
|
|