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

Unified Diff: sdk/lib/_internal/pub/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/lib/src/pubspec.dart ('k') | sdk/lib/_internal/pub_generated/lib/src/pubspec.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 67f927662497d1cd6b022ef68835ed4e39c867e7..542961df9e28dd79bcd977abd6e9978819652e35 100644
--- a/sdk/lib/_internal/pub/test/pubspec_test.dart
+++ b/sdk/lib/_internal/pub/test/pubspec_test.dart
@@ -231,7 +231,23 @@ dependencies:
});
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", () {
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/pubspec.dart ('k') | sdk/lib/_internal/pub_generated/lib/src/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698