1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

more tests on address

This commit is contained in:
V2Ray 2015-09-16 22:24:04 +02:00
parent f9b31afa48
commit 80c5e1973c

View File

@ -17,6 +17,7 @@ func TestIPv4Address(t *testing.T) {
assert.Bool(addr.IsIPv4()).IsTrue()
assert.Bytes(addr.IP).Equals(ip)
assert.Uint16(addr.Port).Equals(port)
assert.String(addr.String()).Equals("1.2.3.4:80")
}
func TestIPv6Address(t *testing.T) {
@ -35,6 +36,7 @@ func TestIPv6Address(t *testing.T) {
assert.Bool(addr.IsIPv6()).IsTrue()
assert.Bytes(addr.IP).Equals(ip)
assert.Uint16(addr.Port).Equals(port)
assert.String(addr.String()).Equals("[102:304:102:304:102:304:102:304]:443")
}
func TestDomainAddress(t *testing.T) {
@ -48,4 +50,5 @@ func TestDomainAddress(t *testing.T) {
assert.Bool(addr.IsDomain()).IsTrue()
assert.String(addr.Domain).Equals(domain)
assert.Uint16(addr.Port).Equals(port)
assert.String(addr.String()).Equals("v2ray.com:443")
}