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

Side by Side Diff: tests/standalone/src/UrlEncodingTest.dart

Issue 9488008: Include HTTP library in the standalone VM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor update Created 8 years, 9 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/standalone/src/HttpTest.dart ('k') | tests/standalone/standalone.status » ('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 #library("url_encoding_test"); 5 #import("dart:io");
6 #import("../../../../chat/http.dart");
7 6
8 void testParseEncodedString() { 7 void testParseEncodedString() {
9 String encodedString = 'foo+bar%20foobar%25%26'; 8 String encodedString = 'foo+bar%20foobar%25%26';
10 Expect.equals(HttpUtil.decodeUrlEncodedString(encodedString), 9 Expect.equals(HttpUtil.decodeUrlEncodedString(encodedString),
11 'foo bar foobar%&'); 10 'foo bar foobar%&');
12 } 11 }
13 12
14 void testParseQueryString() { 13 void testParseQueryString() {
15 // The query string includes escaped "?"s, "&"s, "%"s and "="s. 14 // The query string includes escaped "?"s, "&"s, "%"s and "="s.
16 // These should not affect the splitting of the string. 15 // These should not affect the splitting of the string.
17 String queryString = '%3F=%3D&foo=bar&%26=%25'; 16 String queryString = '%3F=%3D&foo=bar&%26=%25';
18 Map<String, String> map = HttpUtil.splitQueryString(queryString); 17 Map<String, String> map = HttpUtil.splitQueryString(queryString);
19 for (String key in map.getKeys()) { 18 for (String key in map.getKeys()) {
20 Expect.equals(map[key], { '&' : '%', 19 Expect.equals(map[key], { '&' : '%',
21 'foo' : 'bar', 20 'foo' : 'bar',
22 '?' : '='}[key]); 21 '?' : '='}[key]);
23 } 22 }
24 Expect.setEquals(map.getKeys(), ['&', '?', 'foo']); 23 Expect.setEquals(map.getKeys(), ['&', '?', 'foo']);
25 } 24 }
26 25
27 void main() { 26 void main() {
28 testParseEncodedString(); 27 testParseEncodedString();
29 testParseQueryString(); 28 testParseQueryString();
30 } 29 }
OLDNEW
« no previous file with comments | « tests/standalone/src/HttpTest.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698