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

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

Issue 11741026: Add a validator for top-level directory names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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
« utils/pub/validator/directory.dart ('K') | « utils/pub/validator/directory.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 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();
+ });
+ }
+ });
});
}
« utils/pub/validator/directory.dart ('K') | « utils/pub/validator/directory.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698