Chromium Code Reviews| Index: tests/corelib/uri_test.dart |
| diff --git a/tests/corelib/uri_test.dart b/tests/corelib/uri_test.dart |
| index 9e4b24f0d61eb96565ba3f72037dbaf9ace985c0..d4ca36dd9afe8920ef9752c48f57483561068733 100644 |
| --- a/tests/corelib/uri_test.dart |
| +++ b/tests/corelib/uri_test.dart |
| @@ -755,6 +755,25 @@ void testReplace() { |
| Expect.equals("s://:1/b/c?d#e", uri.replace(host: "").toString()); |
| } |
| +void testRegression28359() { |
| + var uri = new Uri(path: "//"); |
| + // This is an invalid path for a URI reference with no authority |
| + // since it looks like an authority. |
| + // Normalized to have an authority. |
| + Expect.equals("////", "$uri"); |
| + Expect.equals("//", uri.path); |
| + Expect.isTrue(uri.hasAuthority, "$uri has authority"); |
| + |
| + uri = new Uri(path: "file:///wat"); |
| + // This is an invalid pat for a URI reference with no authority or scheme |
|
floitsch
2017/01/12 16:05:49
path
Lasse Reichstein Nielsen
2017/01/16 08:17:23
Done.
|
| + // since the path looks like it starts with a scheme. |
| + // Normalized by escaping the ":". |
| + Expect.equals("file%3A///wat", uri.path); |
| + Expect.equals("file%3A///wat", "$uri"); |
| + Expect.isFalse(uri.hasAuthority); |
| + Expect.isFalse(uri.hasScheme); |
| +} |
| + |
| main() { |
| testUri("http:", true); |
| testUri("file:///", true); |
| @@ -921,6 +940,7 @@ main() { |
| testInvalidUrls(); |
| testNormalization(); |
| testReplace(); |
| + testRegression28359(); |
| } |
| String dump(Uri uri) { |