| 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 uriText, bool isAbsolute) { | 10 testUri(String uriText, bool isAbsolute) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 testResolve("s://h/p1/p2/", "."); | 189 testResolve("s://h/p1/p2/", "."); |
| 190 testResolve("s://h/p1/p2/", "./"); | 190 testResolve("s://h/p1/p2/", "./"); |
| 191 testResolve("s://h/p1/", ".."); | 191 testResolve("s://h/p1/", ".."); |
| 192 testResolve("s://h/p1/", "../"); | 192 testResolve("s://h/p1/", "../"); |
| 193 testResolve("s://h/", "../.."); | 193 testResolve("s://h/", "../.."); |
| 194 testResolve("s://h/", "../../"); | 194 testResolve("s://h/", "../../"); |
| 195 testResolve("s://h/p1/%20", "../%20"); | 195 testResolve("s://h/p1/%20", "../%20"); |
| 196 testResolve("s://h/", "../../../.."); | 196 testResolve("s://h/", "../../../.."); |
| 197 testResolve("s://h/", "../../../../"); | 197 testResolve("s://h/", "../../../../"); |
| 198 | 198 |
| 199 base = Uri.parse("s://h/p?q#f%20"); // A non-simpe base | 199 base = Uri.parse("s://h/p?q#f%20"); // A non-simpe base. |
| 200 // Simple references: | 200 // Simple references: |
| 201 testResolve("s2://h2/P?Q#F", "s2://h2/P?Q#F"); | 201 testResolve("s2://h2/P?Q#F", "s2://h2/P?Q#F"); |
| 202 testResolve("s://h2/P?Q#F", "//h2/P?Q#F"); | 202 testResolve("s://h2/P?Q#F", "//h2/P?Q#F"); |
| 203 testResolve("s://h/P?Q#F", "/P?Q#F"); | 203 testResolve("s://h/P?Q#F", "/P?Q#F"); |
| 204 testResolve("s://h/p?Q#F", "?Q#F"); | 204 testResolve("s://h/p?Q#F", "?Q#F"); |
| 205 testResolve("s://h/p?q#F", "#F"); | 205 testResolve("s://h/p?q#F", "#F"); |
| 206 testResolve("s://h/p?q", ""); | 206 testResolve("s://h/p?q", ""); |
| 207 // Non-simple references: | 207 // Non-simple references: |
| 208 testResolve("s2://I@h2/P?Q#F%20", "s2://I@h2/P?Q#F%20"); | 208 testResolve("s2://I@h2/P?Q#F%20", "s2://I@h2/P?Q#F%20"); |
| 209 testResolve("s://I@h2/P?Q#F%20", "//I@h2/P?Q#F%20"); | 209 testResolve("s://I@h2/P?Q#F%20", "//I@h2/P?Q#F%20"); |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 String dump(Uri uri) { | 853 String dump(Uri uri) { |
| 854 return "URI: $uri\n" | 854 return "URI: $uri\n" |
| 855 " Scheme: ${uri.scheme} #${uri.scheme.length}\n" | 855 " Scheme: ${uri.scheme} #${uri.scheme.length}\n" |
| 856 " User-info: ${uri.userInfo} #${uri.userInfo.length}\n" | 856 " User-info: ${uri.userInfo} #${uri.userInfo.length}\n" |
| 857 " Host: ${uri.host} #${uri.host.length}\n" | 857 " Host: ${uri.host} #${uri.host.length}\n" |
| 858 " Port: ${uri.port}\n" | 858 " Port: ${uri.port}\n" |
| 859 " Path: ${uri.path} #${uri.path.length}\n" | 859 " Path: ${uri.path} #${uri.path.length}\n" |
| 860 " Query: ${uri.query} #${uri.query.length}\n" | 860 " Query: ${uri.query} #${uri.query.length}\n" |
| 861 " Fragment: ${uri.fragment} #${uri.fragment.length}\n"; | 861 " Fragment: ${uri.fragment} #${uri.fragment.length}\n"; |
| 862 } | 862 } |
| OLD | NEW |