| Index: src/url_canon_unittest.cc
|
| ===================================================================
|
| --- src/url_canon_unittest.cc (revision 133)
|
| +++ src/url_canon_unittest.cc (working copy)
|
| @@ -761,11 +761,27 @@
|
| if (host_info.family == CanonHostInfo::IPV6) {
|
| EXPECT_STREQ(cases[i].expected, out_str2.c_str());
|
| EXPECT_EQ(cases[i].expected_component.begin, host_info.out_host.begin);
|
| - EXPECT_EQ(cases[i].expected_component.len, host_info.out_host.len);
|
| + EXPECT_EQ(cases[i].expected_compo nent.len, host_info.out_host.len);
|
| }
|
| }
|
| }
|
|
|
| +TEST(URLCanonTest, IPEmpty) {
|
| + std::string out_str1;
|
| + url_canon::StdStringCanonOutput output1(&out_str1);
|
| + url_canon::CanonHostInfo host_info;
|
| +
|
| + // This tests tests.
|
| + const char spec[] = "192.168.0.1";
|
| + url_canon::CanonicalizeIPAddress(spec, url_parse::Component(),
|
| + &output1, &host_info);
|
| + EXPECT_FALSE(host_info.IsIPAddress());
|
| +
|
| + url_canon::CanonicalizeIPAddress(spec, url_parse::Component(0, 0),
|
| + &output1, &host_info);
|
| + EXPECT_FALSE(host_info.IsIPAddress());
|
| +}
|
| +
|
| TEST(URLCanonTest, UserInfo) {
|
| // Note that the canonicalizer should escape and treat empty components as
|
| // not being there.
|
|
|