Index: utils/tests/pub/validator_test.dart |
diff --git a/utils/tests/pub/validator_test.dart b/utils/tests/pub/validator_test.dart |
index 1c064bed10dc132682bed064e5de13170051c0e4..96a8f032b01cbe10c5628fc252699fe91dbd42c3 100644 |
--- a/utils/tests/pub/validator_test.dart |
+++ b/utils/tests/pub/validator_test.dart |
@@ -15,6 +15,7 @@ import '../../pub/entrypoint.dart'; |
import '../../pub/io.dart'; |
import '../../pub/validator.dart'; |
import '../../pub/validator/dependency.dart'; |
+import '../../pub/validator/directory.dart'; |
import '../../pub/validator/lib.dart'; |
import '../../pub/validator/license.dart'; |
import '../../pub/validator/name.dart'; |
@@ -35,6 +36,9 @@ void expectValidationWarning(ValidatorCreator fn) { |
Validator dependency(Entrypoint entrypoint) => |
new DependencyValidator(entrypoint); |
+Validator directory(Entrypoint entrypoint) => |
+ new DirectoryValidator(entrypoint); |
+ |
Validator lib(Entrypoint entrypoint) => new LibValidator(entrypoint); |
Validator license(Entrypoint entrypoint) => new LicenseValidator(entrypoint); |
@@ -121,6 +125,14 @@ main() { |
expectNoValidationError(dependency); |
run(); |
}); |
+ |
+ test('has a nested directory named "tools"', () { |
+ dir(appPath, [ |
+ dir("foo", [dir("tools")]) |
+ ]).scheduleCreate(); |
+ expectNoValidationError(directory); |
+ run(); |
+ }); |
}); |
group('should consider a package invalid if it', () { |
@@ -543,5 +555,18 @@ main() { |
run(); |
}); |
+ |
+ group('has a top-level directory named', () { |
+ setUp(scheduleNormalPackage); |
+ |
+ var names = ["tools", "tests", "docs", "examples", "sample", "samples"]; |
+ for (var name in names) { |
+ test('"$name"', () { |
+ dir(appPath, [dir(name)]).scheduleCreate(); |
+ expectValidationWarning(directory); |
+ run(); |
+ }); |
+ } |
+ }); |
}); |
} |