add tests

This commit is contained in:
nkzawa
2016-02-01 01:50:09 +09:00
parent 48420a6c6f
commit ba723d0460
3 changed files with 71 additions and 6 deletions

View File

@@ -59,4 +59,14 @@ public class UrlTest {
assertThat(id1, is(not(id3)));
assertThat(id2, is(not(id3)));
}
@Test
public void ipv6() throws URISyntaxException, MalformedURLException {
String url = "http://[::1]";
URL parsed = Url.parse(url);
assertThat(parsed.getProtocol(), is("http"));
assertThat(parsed.getHost(), is("[::1]"));
assertThat(parsed.getPort(), is(80));
assertThat(Url.extractId(url), is("http://[::1]:80"));
}
}