Added IPv6 specific test for resolveTAddress.

This commit is contained in:
cheatfate 2018-06-07 15:05:22 +03:00
parent 349bdd5cdf
commit 6709d0b78d
1 changed files with 24 additions and 2 deletions

View File

@ -47,7 +47,8 @@ when isMainModule:
]
var hostnames = [
"www.google.com:443",
"www.github.com:443"
"www.github.com:443",
"localhost:443"
]
for item in numeric:
var taseq = resolveTAddress(item)
@ -75,7 +76,8 @@ when isMainModule:
]
var hostnames = [
"www.google.com",
"www.github.com"
"www.github.com",
"localhost"
]
for item in numeric4:
var taseq = resolveTAddress(item, Port(443))
@ -90,3 +92,23 @@ when isMainModule:
for item in hostnames:
var taseq = resolveTAddress(item, Port(443))
check len(taseq) >= 1
test "resolveTAddress(string) (IPv6 only)":
var hostnames = [
"www.google.com:443",
"www.github.com:443",
"localhost:443"
]
for item in hostnames:
var taseq = resolveTAddress(item, IpAddressFamily.IPv6)
check len(taseq) >= 1
test "resolveTAddress(string, Port) (IPv6 only)":
var hostnames = [
"www.google.com",
"www.github.com",
"localhost"
]
for item in hostnames:
var taseq = resolveTAddress(item, Port(443), IpAddressFamily.IPv6)
check len(taseq) >= 1