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

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

Issue 632483002: Printing a useful error message if a version field is a num (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merging master Created 6 years, 2 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_generated/lib/src/pubspec.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub_generated/test/pubspec_test.dart
diff --git a/sdk/lib/_internal/pub_generated/test/pubspec_test.dart b/sdk/lib/_internal/pub_generated/test/pubspec_test.dart
index 8da6ebdabe3d3699be3e44f8897cd9a39d544e95..925693128dd6beb93125352e5cfd2ce5e2f18327 100644
--- a/sdk/lib/_internal/pub_generated/test/pubspec_test.dart
+++ b/sdk/lib/_internal/pub_generated/test/pubspec_test.dart
@@ -194,7 +194,21 @@ dependencies:
(pubspec) => pubspec.name);
});
test("throws if version is not a string", () {
- expectPubspecException('version: 1.0', (pubspec) => pubspec.version);
+ expectPubspecException('version: [2, 0, 0]',
+ (pubspec) => pubspec.version,
+ '"version" field must be a string');
+ });
+ test("throws if version is malformed (looking like a double)", () {
+ expectPubspecException('version: 2.1',
+ (pubspec) => pubspec.version,
+ '"version" field must have three numeric components: major, minor, '
+ 'and patch. Instead of "2.1", consider "2.1.0"');
+ });
+ test("throws if version is malformed (looking like an int)", () {
+ expectPubspecException('version: 2',
+ (pubspec) => pubspec.version,
+ '"version" field must have three numeric components: major, minor, '
+ 'and patch. Instead of "2", consider "2.0.0"');
});
test("throws if version is not a version", () {
expectPubspecException(
« no previous file with comments | « sdk/lib/_internal/pub_generated/lib/src/pubspec.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698