Skip to content

Commit

Permalink
IPv6 addresses formatting: added test to ensure what this is address,…
Browse files Browse the repository at this point in the history
… not hostname
  • Loading branch information
denizzzka committed Nov 19, 2024
1 parent 5a738b1 commit b816393
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/vibe/core/net.d
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,9 @@ struct NetworkAddress {
unittest {
void test(string ip, string expected = null) {
if(expected is null) expected = ip;
auto w_dns = () @trusted { return resolveHost(ip, AF_UNSPEC, true); } ().toAddressString();
auto res = () @trusted { return resolveHost(ip, AF_UNSPEC, false); } ().toAddressString();
assert(res == w_dns);
assert(res == expected,
"IP "~ip~" yielded wrong string representation: "~res~", expected: "~expected);
}
Expand Down

0 comments on commit b816393

Please sign in to comment.