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

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

Issue 391363004: Include file path in JSON error when possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 5 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
Index: sdk/lib/_internal/pub/test/lock_file_test.dart
diff --git a/sdk/lib/_internal/pub/test/lock_file_test.dart b/sdk/lib/_internal/pub/test/lock_file_test.dart
index c6c5a229f96001042ca307027374fc3b940445bc..68d04ce07fba3adeb56306dfb701fabdba616466 100644
--- a/sdk/lib/_internal/pub/test/lock_file_test.dart
+++ b/sdk/lib/_internal/pub/test/lock_file_test.dart
@@ -110,6 +110,22 @@ packages:
expect(lockFile.packages, isEmpty);
});
+ test("throws if the top level is not a map", () {
+ expect(() {
+ new LockFile.parse('''
+not a map
+''', sources);
+ }, throwsFormatException);
+ });
+
+ test("throws if the contents of 'packages' is not a map", () {
+ expect(() {
+ new LockFile.parse('''
+packages: not a map
+''', sources);
+ }, throwsFormatException);
+ });
+
test("throws if the version is missing", () {
expect(() {
new LockFile.parse('''

Powered by Google App Engine
This is Rietveld 408576698