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

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

Issue 11519049: Validate that a single library has the same name as the package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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/name.dart ('K') | « utils/pub/validator/name.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 d9877eb45de9c678b220df0939f5f386b3590d78..40576ac34ca7ee23a42cca53364a9103441d1008 100644
--- a/utils/tests/pub/validator_test.dart
+++ b/utils/tests/pub/validator_test.dart
@@ -210,7 +210,7 @@ main() {
run();
});
- test('has a package name that is a Dart identifier', () {
+ test('has a package name that is a Dart reserved word', () {
dir(appPath, [libPubspec("operator", "1.0.0")]).scheduleCreate();
expectValidationError(name);
run();
@@ -243,7 +243,7 @@ main() {
run();
});
- test('has a library name that is a Dart identifier', () {
+ test('has a library name that is a Dart reserved word', () {
dir(appPath, [
libPubspec("test_pkg", "1.0.0"),
dir("lib", [file("operator.dart", "int i = 0;")])
@@ -252,6 +252,15 @@ main() {
run();
});
+ test('has a single library named differently than the package', () {
+ file(join(appPath, "lib", "test_pkg.dart"), '').scheduleDelete();
+ dir(appPath, [
+ dir("lib", [file("best_pkg.dart", "int i = 0;")])
+ ]).scheduleCreate();
+ expectValidationWarning(name);
+ run();
+ });
+
test('has no lib directory', () {
dir(join(appPath, "lib")).scheduleDelete();
expectValidationError(lib);
« utils/pub/validator/name.dart ('K') | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698