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

Unified Diff: sdk/lib/_internal/pub/test/pubspec_test.dart

Issue 351703004: Improve pub's pubspec error messages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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
« no previous file with comments | « sdk/lib/_internal/pub/test/pub_get_and_upgrade_test.dart ('k') | sdk/lib/_internal/pub/test/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/pubspec_test.dart
diff --git a/sdk/lib/_internal/pub/test/pubspec_test.dart b/sdk/lib/_internal/pub/test/pubspec_test.dart
index b4361a3efbe532d8a41b1c1690597f9ba0948c50..b2f5914e69774da87c4de9664547fa1e01fb3a36 100644
--- a/sdk/lib/_internal/pub/test/pubspec_test.dart
+++ b/sdk/lib/_internal/pub/test/pubspec_test.dart
@@ -248,13 +248,13 @@ dependencies:
test("throws if a transformer isn't a string or map", () {
expectPubspecException('transformers: [12]',
(pubspec) => pubspec.transformers,
- '"transformers" field must be a string or map');
+ 'A transformer must be a string or map.');
});
test("throws if a transformer's configuration isn't a map", () {
expectPubspecException('transformers: [{pkg: 12}]',
(pubspec) => pubspec.transformers,
- '"transformers.pkg" field must be a map');
+ "A transformer's configuration must be a map.");
});
test("throws if a transformer's configuration contains an unknown "
@@ -263,8 +263,7 @@ dependencies:
name: pkg
transformers: [{pkg: {\$key: "value"}}]''',
(pubspec) => pubspec.transformers,
- 'Invalid transformer configuration for "transformers.pkg": '
- 'Unknown reserved field "\$key"');
+ 'Invalid transformer config: Unknown reserved field.');
});
test("doesn't throw if a transformer's configuration contains a "
@@ -285,8 +284,8 @@ name: pkg
transformers:
- pkg: {\$include: 123}''',
(pubspec) => pubspec.transformers,
- 'Invalid transformer configuration for "transformers.pkg": '
- '"\$include" field must be a string or list, but was "123"');
+ 'Invalid transformer config: "\$include" field must be a string or '
+ 'list.');
});
test("throws if the \$include list contains a non-string", () {
@@ -295,9 +294,8 @@ name: pkg
transformers:
- pkg: {\$include: ["ok", 123, "alright", null]}''',
(pubspec) => pubspec.transformers,
- 'Invalid transformer configuration for "transformers.pkg": '
- '"\$include" list field may only contain strings, but contained '
- '"123" and "null"');
+ 'Invalid transformer config: "\$include" field may contain only '
+ 'strings.');
});
test("throws if the \$exclude value is not a string or list", () {
@@ -306,8 +304,8 @@ name: pkg
transformers:
- pkg: {\$exclude: 123}''',
(pubspec) => pubspec.transformers,
- 'Invalid transformer configuration for "transformers.pkg": '
- '"\$exclude" field must be a string or list, but was "123"');
+ 'Invalid transformer config: "\$exclude" field must be a string or '
+ 'list.');
});
test("throws if the \$exclude list contains a non-string", () {
@@ -316,9 +314,8 @@ name: pkg
transformers:
- pkg: {\$exclude: ["ok", 123, "alright", null]}''',
(pubspec) => pubspec.transformers,
- 'Invalid transformer configuration for "transformers.pkg": '
- '"\$exclude" list field may only contain strings, but contained '
- '"123" and "null"');
+ 'Invalid transformer config: "\$exclude" field may contain only '
+ 'strings.');
});
test("throws if a transformer is not from a dependency", () {
@@ -327,7 +324,7 @@ name: pkg
transformers: [foo]
''',
(pubspec) => pubspec.transformers,
- '"transformers.foo" refers to a package that\'s not a dependency.');
+ '"foo" is not a dependency.');
});
test("allows a transformer from a normal dependency", () {
« no previous file with comments | « sdk/lib/_internal/pub/test/pub_get_and_upgrade_test.dart ('k') | sdk/lib/_internal/pub/test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698