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

Side by Side Diff: tests/standalone/io/url_encoding_test.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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/standalone/io/process_environment_test.dart ('k') | utils/apidoc/html_diff.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:utf"); 5 #import("dart:utf");
6 #source("../../../runtime/bin/input_stream.dart"); 6 #source("../../../runtime/bin/input_stream.dart");
7 #source("../../../runtime/bin/output_stream.dart"); 7 #source("../../../runtime/bin/output_stream.dart");
8 #source("../../../runtime/bin/chunked_stream.dart"); 8 #source("../../../runtime/bin/chunked_stream.dart");
9 #source("../../../runtime/bin/string_stream.dart"); 9 #source("../../../runtime/bin/string_stream.dart");
10 #source("../../../runtime/bin/stream_util.dart"); 10 #source("../../../runtime/bin/stream_util.dart");
11 #source("../../../runtime/bin/http.dart"); 11 #source("../../../runtime/bin/http.dart");
12 #source("../../../runtime/bin/http_impl.dart"); 12 #source("../../../runtime/bin/http_impl.dart");
13 #source("../../../runtime/bin/http_parser.dart"); 13 #source("../../../runtime/bin/http_parser.dart");
14 #source("../../../runtime/bin/http_utils.dart"); 14 #source("../../../runtime/bin/http_utils.dart");
15 15
16 void testParseEncodedString() { 16 void testParseEncodedString() {
17 String encodedString = 'foo+bar%20foobar%25%26'; 17 String encodedString = 'foo+bar%20foobar%25%26';
18 Expect.equals(_HttpUtils.decodeUrlEncodedString(encodedString), 18 Expect.equals(_HttpUtils.decodeUrlEncodedString(encodedString),
19 'foo bar foobar%&'); 19 'foo bar foobar%&');
20 } 20 }
21 21
22 void testParseQueryString() { 22 void testParseQueryString() {
23 // The query string includes escaped "?"s, "&"s, "%"s and "="s. 23 // The query string includes escaped "?"s, "&"s, "%"s and "="s.
24 // These should not affect the splitting of the string. 24 // These should not affect the splitting of the string.
25 String queryString = 25 String queryString =
26 '%3F=%3D&foo=bar&%26=%25&sqrt2=%E2%88%9A2&name=Franti%C5%A1ek'; 26 '%3F=%3D&foo=bar&%26=%25&sqrt2=%E2%88%9A2&name=Franti%C5%A1ek';
27 Map<String, String> map = _HttpUtils.splitQueryString(queryString); 27 Map<String, String> map = _HttpUtils.splitQueryString(queryString);
28 for (String key in map.getKeys()) { 28 for (String key in map.keys) {
29 Expect.equals(map[key], { '&' : '%', 29 Expect.equals(map[key], { '&' : '%',
30 'foo' : 'bar', 30 'foo' : 'bar',
31 '?' : '=', 31 '?' : '=',
32 'sqrt2' : '\u221A2', 32 'sqrt2' : '\u221A2',
33 'name' : 'Franti\u0161ek'}[key]); 33 'name' : 'Franti\u0161ek'}[key]);
34 } 34 }
35 Expect.setEquals(map.getKeys(), ['&', '?', 'foo', 'sqrt2', 'name']); 35 Expect.setEquals(map.keys, ['&', '?', 'foo', 'sqrt2', 'name']);
36 } 36 }
37 37
38 void main() { 38 void main() {
39 testParseEncodedString(); 39 testParseEncodedString();
40 testParseQueryString(); 40 testParseQueryString();
41 } 41 }
OLDNEW
« no previous file with comments | « tests/standalone/io/process_environment_test.dart ('k') | utils/apidoc/html_diff.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698