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

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

Issue 15777002: Use indentation for maps in lockfile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 7 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
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 'description': 'foo desc' 181 'description': 'foo desc'
182 }, 182 },
183 'bar': { 183 'bar': {
184 'version': '3.2.1', 184 'version': '3.2.1',
185 'source': 'mock', 185 'source': 'mock',
186 'description': 'bar desc' 186 'description': 'bar desc'
187 } 187 }
188 } 188 }
189 })); 189 }));
190 }); 190 });
191
192 test('lockfile is alphabetized by package name', () {
193 var testNames = ['baz', 'Qwe', 'Q', 'B', 'Bar', 'bar', 'foo'];
194 testNames.forEach((name) {
195 lockfile.packages[name] = new PackageId(name, mockSource.name,
196 new Version.parse('5.5.5'), '$name desc');
197 });
198
199 expect(lockfile.serialize(),
200 '# Generated by pub\n'
201 '# See http://pub.dartlang.org/doc/glossary.html#lockfile\n'
202 '\n'
203 '{"packages":{'
204 '"B":{"version":"5.5.5","source":"mock","description":"B desc"},'
205 '"Bar":{"version":"5.5.5","source":"mock","description":"Bar desc"},'
206 '"Q":{"version":"5.5.5","source":"mock","description":"Q desc"},'
207 '"Qwe":{"version":"5.5.5","source":"mock","description":"Qwe desc"},'
208 '"bar":{"version":"5.5.5","source":"mock","description":"bar desc"},'
209 '"baz":{"version":"5.5.5","source":"mock","description":"baz desc"},'
210 '"foo":{"version":"5.5.5","source":"mock","description":"foo desc"}}}'
211 '\n'
212 );
213 });
214 }); 191 });
215 }); 192 });
216 } 193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698