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

Side by Side Diff: sdk/lib/_internal/pub/test/lock_file_test.dart

Issue 26263004: Handle a null dependencies map in lockfile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/lock_file.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library lock_file_test; 5 library lock_file_test;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'package:yaml/yaml.dart'; 8 import 'package:yaml/yaml.dart';
9 9
10 import '../lib/src/lock_file.dart'; 10 import '../lib/src/lock_file.dart';
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 packages: 82 packages:
83 foo: 83 foo:
84 source: bad 84 source: bad
85 version: 1.2.3 85 version: 1.2.3
86 description: foo desc 86 description: foo desc
87 ''', sources); 87 ''', sources);
88 var foo = lockFile.packages['foo']; 88 var foo = lockFile.packages['foo'];
89 expect(foo.source, equals('bad')); 89 expect(foo.source, equals('bad'));
90 }); 90 });
91 91
92 test("allows an empty dependency map", () {
93 var lockFile = new LockFile.parse('''
94 packages:
95 ''', sources);
96 expect(lockFile.packages, isEmpty);
97 });
98
92 test("throws if the version is missing", () { 99 test("throws if the version is missing", () {
93 expect(() { 100 expect(() {
94 new LockFile.parse(''' 101 new LockFile.parse('''
95 packages: 102 packages:
96 foo: 103 foo:
97 source: mock 104 source: mock
98 description: foo desc 105 description: foo desc
99 ''', sources); 106 ''', sources);
100 }, throwsFormatException); 107 }, throwsFormatException);
101 }); 108 });
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 'version': '3.2.1', 190 'version': '3.2.1',
184 'source': 'mock', 191 'source': 'mock',
185 'description': 'bar desc' 192 'description': 'bar desc'
186 } 193 }
187 } 194 }
188 })); 195 }));
189 }); 196 });
190 }); 197 });
191 }); 198 });
192 } 199 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/lock_file.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698