OLD | NEW |
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('../../lib/utf/utf.dart'); | 7 import 'dart:utf'; |
8 #import('../../lib/uri/uri.dart'); | 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 } | 15 } |
16 | 16 |
17 testEncodeDecode(String orig, String encoded) { | 17 testEncodeDecode(String orig, String encoded) { |
18 var e = encodeUri(orig); | 18 var e = encodeUri(orig); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); | 203 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); |
204 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); | 204 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); |
205 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); | 205 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); |
206 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); | 206 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); |
207 testEncodeDecodeComponent("\x7f", "%7F"); | 207 testEncodeDecodeComponent("\x7f", "%7F"); |
208 testEncodeDecodeComponent("\x80", "%C2%80"); | 208 testEncodeDecodeComponent("\x80", "%C2%80"); |
209 testEncodeDecodeComponent("\u0800", "%E0%A0%80"); | 209 testEncodeDecodeComponent("\u0800", "%E0%A0%80"); |
210 testEncodeDecodeComponent(":/@',;?&=+\$", "%3A%2F%40'%2C%3B%3F%26%3D%2B%24"); | 210 testEncodeDecodeComponent(":/@',;?&=+\$", "%3A%2F%40'%2C%3B%3F%26%3D%2B%24"); |
211 testEncodeDecodeComponent(s, "%F0%90%80%80"); | 211 testEncodeDecodeComponent(s, "%F0%90%80%80"); |
212 } | 212 } |
OLD | NEW |