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

Side by Side Diff: tests/utils/uri_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch 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/utils/recursive_import_test.dart ('k') | tests/utils/utils.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 uriTest; 5 library uriTest;
6 6
7 import 'dart:utf'; 7 import 'dart:utf';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 testUri(String uri, bool isAbsolute) { 10 testUri(String uri, bool isAbsolute) {
11 Expect.equals(isAbsolute, new Uri.fromString(uri).isAbsolute()); 11 Expect.equals(isAbsolute, new Uri.fromString(uri).isAbsolute());
12 Expect.equals(isAbsolute, new Uri(uri).isAbsolute()); 12 Expect.equals(isAbsolute, new Uri(uri).isAbsolute());
13 Expect.stringEquals(uri, new Uri.fromString(uri).toString()); 13 Expect.stringEquals(uri, new Uri.fromString(uri).toString());
14 Expect.stringEquals(uri, new Uri(uri).toString()); 14 Expect.stringEquals(uri, new Uri(uri).toString());
15
16 // Test equals and hashCode members.
17 Expect.equals(new Uri(uri), new Uri(uri));
18 Expect.equals(new Uri(uri).hashCode, new Uri(uri).hashCode);
15 } 19 }
16 20
17 testEncodeDecode(String orig, String encoded) { 21 testEncodeDecode(String orig, String encoded) {
18 var e = encodeUri(orig); 22 var e = encodeUri(orig);
19 Expect.stringEquals(encoded, e); 23 Expect.stringEquals(encoded, e);
20 var d = decodeUri(encoded); 24 var d = decodeUri(encoded);
21 Expect.stringEquals(orig, d); 25 Expect.stringEquals(orig, d);
22 } 26 }
23 27
24 testEncodeDecodeComponent(String orig, String encoded) { 28 testEncodeDecodeComponent(String orig, String encoded) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); 209 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE");
206 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); 210 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF");
207 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); 211 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE");
208 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); 212 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF");
209 testEncodeDecodeComponent("\x7f", "%7F"); 213 testEncodeDecodeComponent("\x7f", "%7F");
210 testEncodeDecodeComponent("\x80", "%C2%80"); 214 testEncodeDecodeComponent("\x80", "%C2%80");
211 testEncodeDecodeComponent("\u0800", "%E0%A0%80"); 215 testEncodeDecodeComponent("\u0800", "%E0%A0%80");
212 testEncodeDecodeComponent(":/@',;?&=+\$", "%3A%2F%40'%2C%3B%3F%26%3D%2B%24"); 216 testEncodeDecodeComponent(":/@',;?&=+\$", "%3A%2F%40'%2C%3B%3F%26%3D%2B%24");
213 testEncodeDecodeComponent(s, "%F0%90%80%80"); 217 testEncodeDecodeComponent(s, "%F0%90%80%80");
214 } 218 }
OLDNEW
« no previous file with comments | « tests/utils/recursive_import_test.dart ('k') | tests/utils/utils.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698