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

Side by Side Diff: utils/tests/pub/test_pub.dart

Issue 11664006: Make Map.keys/values Iterables. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Add TODO that map.keys should return a Set. Created 7 years, 11 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 | « utils/template/parser.dart ('k') | utils/tests/pub/version_solver_test.dart » ('j') | 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 /** 5 /**
6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub
7 * tests are integration tests that stage some stuff on the file system, run 7 * tests are integration tests that stage some stuff on the file system, run
8 * pub, and then validate the results. This library provides an API to build 8 * pub, and then validate the results. This library provides an API to build
9 * tests like that. 9 * tests like that.
10 */ 10 */
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 for (var spec in resolvedPubspecs) { 189 for (var spec in resolvedPubspecs) {
190 var name = spec['name']; 190 var name = spec['name'];
191 var version = spec['version']; 191 var version = spec['version'];
192 var versions = _servedPackages.putIfAbsent( 192 var versions = _servedPackages.putIfAbsent(
193 name, () => <String, String>{}); 193 name, () => <String, String>{});
194 versions[version] = yaml(spec); 194 versions[version] = yaml(spec);
195 } 195 }
196 196
197 _servedPackageDir.contents.clear(); 197 _servedPackageDir.contents.clear();
198 for (var name in _servedPackages.keys) { 198 for (var name in _servedPackages.keys) {
199 var versions = _servedPackages[name].keys; 199 var versions = _servedPackages[name].keys.toList());
200 _servedPackageDir.contents.addAll([ 200 _servedPackageDir.contents.addAll([
201 file('$name.json', 201 file('$name.json',
202 json.stringify({'versions': versions})), 202 json.stringify({'versions': versions})),
203 dir(name, [ 203 dir(name, [
204 dir('versions', flatten(versions.mappedBy((version) { 204 dir('versions', flatten(versions.mappedBy((version) {
205 return [ 205 return [
206 file('$version.yaml', _servedPackages[name][version]), 206 file('$version.yaml', _servedPackages[name][version]),
207 tar('$version.tar.gz', [ 207 tar('$version.tar.gz', [
208 file('pubspec.yaml', _servedPackages[name][version]), 208 file('pubspec.yaml', _servedPackages[name][version]),
209 libDir(name, '$name $version') 209 libDir(name, '$name $version')
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 /// calling [completion] is unnecessary. 1663 /// calling [completion] is unnecessary.
1664 void expectLater(Future actual, matcher, {String reason, 1664 void expectLater(Future actual, matcher, {String reason,
1665 FailureHandler failureHandler, bool verbose: false}) { 1665 FailureHandler failureHandler, bool verbose: false}) {
1666 _schedule((_) { 1666 _schedule((_) {
1667 return actual.then((value) { 1667 return actual.then((value) {
1668 expect(value, matcher, reason: reason, failureHandler: failureHandler, 1668 expect(value, matcher, reason: reason, failureHandler: failureHandler,
1669 verbose: false); 1669 verbose: false);
1670 }); 1670 });
1671 }); 1671 });
1672 } 1672 }
OLDNEW
« no previous file with comments | « utils/template/parser.dart ('k') | utils/tests/pub/version_solver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698