| 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 "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 testUri(String uri, bool isAbsolute) { | 10 testUri(String uri, bool isAbsolute) { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); | 249 testEncodeDecodeComponent("\uFFFE", "%EF%BF%BE"); |
| 250 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); | 250 testEncodeDecodeComponent("\uFFFF", "%EF%BF%BF"); |
| 251 testEncodeDecodeComponent("\x7f", "%7F"); | 251 testEncodeDecodeComponent("\x7f", "%7F"); |
| 252 testEncodeDecodeComponent("\x80", "%C2%80"); | 252 testEncodeDecodeComponent("\x80", "%C2%80"); |
| 253 testEncodeDecodeComponent("\u0800", "%E0%A0%80"); | 253 testEncodeDecodeComponent("\u0800", "%E0%A0%80"); |
| 254 testEncodeDecodeComponent(":/@',;?&=+\$", "%3A%2F%40'%2C%3B%3F%26%3D%2B%24"); | 254 testEncodeDecodeComponent(":/@',;?&=+\$", "%3A%2F%40'%2C%3B%3F%26%3D%2B%24"); |
| 255 testEncodeDecodeComponent(s, "%F0%90%80%80"); | 255 testEncodeDecodeComponent(s, "%F0%90%80%80"); |
| 256 testEncodeDecodeQueryComponent("A + B", "A+%2B+B", "A+%2B+B", "A+%2B+B"); | 256 testEncodeDecodeQueryComponent("A + B", "A+%2B+B", "A+%2B+B", "A+%2B+B"); |
| 257 testEncodeDecodeQueryComponent( | 257 testEncodeDecodeQueryComponent( |
| 258 "æ ø å", "%C3%A6+%C3%B8+%C3%A5", "%E6+%F8+%E5", null); | 258 "æ ø å", "%C3%A6+%C3%B8+%C3%A5", "%E6+%F8+%E5", null); |
| 259 |
| 260 // Invalid URI - : and @ is swapped, port ("host") should be numeric. |
| 261 Expect.throws( |
| 262 () => Uri.parse("file://user@password:host/path"), |
| 263 (e) => e is FormatException); |
| 259 } | 264 } |
| OLD | NEW |