7023363: URI("ftp", "[www.abc.com]", "/dir1/dir2", "query", "frag") should throw URISyntaxException
Reviewed-by: alanb, michaelm
diff --git a/test/java/net/URI/Test.java b/test/java/net/URI/Test.java
index f0bb8da..3f157ea 100644
--- a/test/java/net/URI/Test.java
+++ b/test/java/net/URI/Test.java
@@ -23,7 +23,7 @@
/* @test
* @summary Unit test for java.net.URI
- * @bug 4464135 4505046 4503239 4438319 4991359 4866303
+ * @bug 4464135 4505046 4503239 4438319 4991359 4866303 7023363
* @author Mark Reinhold
*/
@@ -1050,6 +1050,13 @@
test("http://1.2.3.4.5").psa().x().z();
test("http://[1.2.3.4:5]").x().z();
test("http://1:2:3:4:5:6:7:8").psa().x().z();
+ test("http://[1.2.3.4]/").x().z();
+ test("http://[1.2.3.4/").x().z();
+ test("http://[foo]/").x().z();
+ test("http://[foo/").x().z();
+ test("s", "[foo]", "/", null, null).x().z();
+ test("s", "[foo", "/", null, null).x().z();
+ test("s", "[::foo", "/", null, null).x().z();
// Test hostnames that might initially look like IPv4 addresses