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

Side by Side Diff: tests/standalone/io/url_encoding_test.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 | « tests/language/ordered_maps_test.dart ('k') | utils/apidoc/mdn/prettyPrint.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 import "dart:async"; 5 import "dart:async";
6 import "dart:utf"; 6 import "dart:utf";
7 part "../../../sdk/lib/io/input_stream.dart"; 7 part "../../../sdk/lib/io/input_stream.dart";
8 part "../../../sdk/lib/io/output_stream.dart"; 8 part "../../../sdk/lib/io/output_stream.dart";
9 part "../../../sdk/lib/io/chunked_stream.dart"; 9 part "../../../sdk/lib/io/chunked_stream.dart";
10 part "../../../sdk/lib/io/string_stream.dart"; 10 part "../../../sdk/lib/io/string_stream.dart";
(...skipping 15 matching lines...) Expand all
26 String queryString = 26 String queryString =
27 '%3F=%3D&foo=bar&%26=%25&sqrt2=%E2%88%9A2&name=Franti%C5%A1ek'; 27 '%3F=%3D&foo=bar&%26=%25&sqrt2=%E2%88%9A2&name=Franti%C5%A1ek';
28 Map<String, String> map = _HttpUtils.splitQueryString(queryString); 28 Map<String, String> map = _HttpUtils.splitQueryString(queryString);
29 for (String key in map.keys) { 29 for (String key in map.keys) {
30 Expect.equals(map[key], { '&' : '%', 30 Expect.equals(map[key], { '&' : '%',
31 'foo' : 'bar', 31 'foo' : 'bar',
32 '?' : '=', 32 '?' : '=',
33 'sqrt2' : '\u221A2', 33 'sqrt2' : '\u221A2',
34 'name' : 'Franti\u0161ek'}[key]); 34 'name' : 'Franti\u0161ek'}[key]);
35 } 35 }
36 Expect.setEquals(map.keys, ['&', '?', 'foo', 'sqrt2', 'name']); 36 Expect.setEquals(map.keys.toSet(), ['&', '?', 'foo', 'sqrt2', 'name']);
37 } 37 }
38 38
39 void main() { 39 void main() {
40 testParseEncodedString(); 40 testParseEncodedString();
41 testParseQueryString(); 41 testParseQueryString();
42 } 42 }
OLDNEW
« no previous file with comments | « tests/language/ordered_maps_test.dart ('k') | utils/apidoc/mdn/prettyPrint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698