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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 testResolve("../../../d", "../../../d"); | 217 testResolve("../../../d", "../../../d"); |
218 setBase("../../a/b"); | 218 setBase("../../a/b"); |
219 testResolve("../../a/d", "d"); | 219 testResolve("../../a/d", "d"); |
220 testResolve("../../d", "../d"); | 220 testResolve("../../d", "../d"); |
221 testResolve("../../../d", "../../d"); | 221 testResolve("../../../d", "../../d"); |
222 setBase("../../a"); | 222 setBase("../../a"); |
223 testResolve("../../d", "d"); | 223 testResolve("../../d", "d"); |
224 testResolve("../../../d", "../d"); | 224 testResolve("../../../d", "../d"); |
225 testResolve("../../../../d", "../../d"); | 225 testResolve("../../../../d", "../../d"); |
226 | 226 |
227 // Absoluyte path, not scheme or authority. | 227 // Absolute path, not scheme or authority. |
228 setBase("/a"); | 228 setBase("/a"); |
229 testResolve("/b", "b"); | 229 testResolve("/b", "b"); |
230 testResolve("/b", "../b"); | 230 testResolve("/b", "../b"); |
231 testResolve("/b", "../../b"); | 231 testResolve("/b", "../../b"); |
232 setBase("/a/b"); | 232 setBase("/a/b"); |
233 testResolve("/a/c", "c"); | 233 testResolve("/a/c", "c"); |
234 testResolve("/c", "../c"); | 234 testResolve("/c", "../c"); |
235 testResolve("/c", "../../c"); | 235 testResolve("/c", "../../c"); |
236 | 236 |
237 setBase("s://h/p?q#f"); // A simple base. | 237 setBase("s://h/p?q#f"); // A simple base. |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 String dump(Uri uri) { | 966 String dump(Uri uri) { |
967 return "URI: $uri\n" | 967 return "URI: $uri\n" |
968 " Scheme: ${uri.scheme} #${uri.scheme.length}\n" | 968 " Scheme: ${uri.scheme} #${uri.scheme.length}\n" |
969 " User-info: ${uri.userInfo} #${uri.userInfo.length}\n" | 969 " User-info: ${uri.userInfo} #${uri.userInfo.length}\n" |
970 " Host: ${uri.host} #${uri.host.length}\n" | 970 " Host: ${uri.host} #${uri.host.length}\n" |
971 " Port: ${uri.port}\n" | 971 " Port: ${uri.port}\n" |
972 " Path: ${uri.path} #${uri.path.length}\n" | 972 " Path: ${uri.path} #${uri.path.length}\n" |
973 " Query: ${uri.query} #${uri.query.length}\n" | 973 " Query: ${uri.query} #${uri.query.length}\n" |
974 " Fragment: ${uri.fragment} #${uri.fragment.length}\n"; | 974 " Fragment: ${uri.fragment} #${uri.fragment.length}\n"; |
975 } | 975 } |
OLD | NEW |