diff options
Diffstat (limited to 'luni/src/test/java/libcore/java/net/URLTest.java')
-rw-r--r-- | luni/src/test/java/libcore/java/net/URLTest.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/luni/src/test/java/libcore/java/net/URLTest.java b/luni/src/test/java/libcore/java/net/URLTest.java index a18816b..07e651c 100644 --- a/luni/src/test/java/libcore/java/net/URLTest.java +++ b/luni/src/test/java/libcore/java/net/URLTest.java @@ -350,7 +350,7 @@ public final class URLTest extends TestCase { } } - public void testNegativePort() throws Exception { + public void testPortWithMinusSign() throws Exception { try { new URL("http://host:-2/"); fail(); @@ -358,6 +358,22 @@ public final class URLTest extends TestCase { } } + public void testPortWithPlusSign() throws Exception { + try { + new URL("http://host:+2/"); + fail(); + } catch (MalformedURLException expected) { + } + } + + public void testPortNonASCII() throws Exception { + try { + new URL("http://host:١٢٣/"); // 123 in arabic + fail(); + } catch (MalformedURLException expected) { + } + } + public void testNegativePortEqualsPlaceholder() throws Exception { try { new URL("http://host:-1/"); |