MXS-3326 Add test that reveals problem
A hyphen '-' is a valid character in a domain name, as long as it is not the first character and does not appear two in a row.
This commit is contained in:
@ -88,6 +88,7 @@ try
|
|||||||
test("[fe80::37f8:99a2:558a:9f5d]:4001", maxbase::Host::Type::IPV6);
|
test("[fe80::37f8:99a2:558a:9f5d]:4001", maxbase::Host::Type::IPV6);
|
||||||
test("[::]:4001", maxbase::Host::Type::IPV6);
|
test("[::]:4001", maxbase::Host::Type::IPV6);
|
||||||
test("google.com:80", maxbase::Host::Type::HostName);
|
test("google.com:80", maxbase::Host::Type::HostName);
|
||||||
|
test("hello-world.fi:3333", maxbase::Host::Type::HostName);
|
||||||
|
|
||||||
std::cout << "The following should be INVALID!!!!!\n";
|
std::cout << "The following should be INVALID!!!!!\n";
|
||||||
test("/tmp/socket/", maxbase::Host::Type::Invalid);
|
test("/tmp/socket/", maxbase::Host::Type::Invalid);
|
||||||
@ -96,6 +97,8 @@ try
|
|||||||
test("[127.0.0.1]:", maxbase::Host::Type::Invalid);
|
test("[127.0.0.1]:", maxbase::Host::Type::Invalid);
|
||||||
test("[127.0.0.1:", maxbase::Host::Type::Invalid);
|
test("[127.0.0.1:", maxbase::Host::Type::Invalid);
|
||||||
test("_hello_world.fi:3333", maxbase::Host::Type::Invalid);
|
test("_hello_world.fi:3333", maxbase::Host::Type::Invalid);
|
||||||
|
test("-hello_world.fi:3333", maxbase::Host::Type::Invalid);
|
||||||
|
test("hello--world.fi:3333", maxbase::Host::Type::Invalid);
|
||||||
|
|
||||||
std::cout << "\nRegular Constructor!!!!!\n";
|
std::cout << "\nRegular Constructor!!!!!\n";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user