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('../../../utils/uri/uri.dart'); | 7 #import('../../../lib/uri/uri.dart'); |
8 | 8 |
9 testUri(String uri, bool isAbsolute) { | 9 testUri(String uri, bool isAbsolute) { |
10 Expect.equals(isAbsolute, new Uri.fromString(uri).isAbsolute()); | 10 Expect.equals(isAbsolute, new Uri.fromString(uri).isAbsolute()); |
11 Expect.stringEquals(uri, new Uri.fromString(uri).toString()); | 11 Expect.stringEquals(uri, new Uri.fromString(uri).toString()); |
12 } | 12 } |
13 | 13 |
14 main() { | 14 main() { |
15 testUri("http:", true); | 15 testUri("http:", true); |
16 testUri("file://", true); | 16 testUri("file://", true); |
17 testUri("file", false); | 17 testUri("file", false); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 Expect.stringEquals("http://a/b/c/g#s/./x", | 84 Expect.stringEquals("http://a/b/c/g#s/./x", |
85 base.resolve("g#s/./x").toString()); | 85 base.resolve("g#s/./x").toString()); |
86 Expect.stringEquals("http://a/b/c/g#s/../x", | 86 Expect.stringEquals("http://a/b/c/g#s/../x", |
87 base.resolve("g#s/../x").toString()); | 87 base.resolve("g#s/../x").toString()); |
88 Expect.stringEquals("http:g", base.resolve("http:g").toString()); | 88 Expect.stringEquals("http:g", base.resolve("http:g").toString()); |
89 | 89 |
90 // Additional tests (not from RFC 3986). | 90 // Additional tests (not from RFC 3986). |
91 Expect.stringEquals("http://a/b/g;p/h;s", | 91 Expect.stringEquals("http://a/b/g;p/h;s", |
92 base.resolve("../g;p/h;s").toString()); | 92 base.resolve("../g;p/h;s").toString()); |
93 } | 93 } |
OLD | NEW |