test/java/net/URI/Test.java

Print this page

        

@@ -21,11 +21,11 @@
  * questions.
  */
 
 /* @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
  */
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;

@@ -1048,10 +1048,17 @@
         test("http://1.2.3").psa().x().z();
         test("http://1.2.3.300").psa().x().z();
         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
 
         test("s://1.2.3.com").psa().s("s").h("1.2.3.com").p("").z();
         test("s://1.2.3.4me.com").psa().s("s").h("1.2.3.4me.com").p("").z();