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(''' |