Add more test for MalformedURLException am: 8fb5c96082 am: 9993b98822

Original change: https://googleplex-android-review.googlesource.com/c/platform/libcore/+/18234478

Change-Id: Ia0844988d2af43ab4f65b91ce82c243705fc3579
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java b/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java
index b9998da..b60b7b8 100644
--- a/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java
+++ b/luni/src/test/java/libcore/java/net/MalformedURLExceptionTest.java
@@ -17,6 +17,7 @@
 package libcore.java.net;
 
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
 import java.net.MalformedURLException;
@@ -28,8 +29,12 @@
 public class MalformedURLExceptionTest {
 
     @Test
-    public void testEmptyConstructor() {
+    public void testConstructor() {
         MalformedURLException e = new MalformedURLException();
         assertNull(e.getMessage());
+
+        String msg = "x:yyy is not valid URL";
+        e = new MalformedURLException(msg);
+        assertEquals(msg, e.getMessage());
     }
 }