diff --git a/common/net/address_test.go b/common/net/address_test.go index 9ddeb6f7..29b62fe2 100644 --- a/common/net/address_test.go +++ b/common/net/address_test.go @@ -14,6 +14,8 @@ func TestIPv4Address(t *testing.T) { addr := IPAddress(ip, port) assert.Bool(addr.IsIPv4()).IsTrue() + assert.Bool(addr.IsIPv6()).IsFalse() + assert.Bool(addr.IsDomain()).IsFalse() assert.Bytes(addr.IP()).Equals(ip) assert.Uint16(addr.Port()).Equals(port) assert.String(addr.String()).Equals("1.2.3.4:80") @@ -32,6 +34,8 @@ func TestIPv6Address(t *testing.T) { addr := IPAddress(ip, port) assert.Bool(addr.IsIPv6()).IsTrue() + assert.Bool(addr.IsIPv4()).IsFalse() + assert.Bool(addr.IsDomain()).IsFalse() 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") @@ -45,6 +49,8 @@ func TestDomainAddress(t *testing.T) { addr := DomainAddress(domain, port) assert.Bool(addr.IsDomain()).IsTrue() + assert.Bool(addr.IsIPv4()).IsFalse() + assert.Bool(addr.IsIPv6()).IsFalse() assert.String(addr.Domain()).Equals(domain) assert.Uint16(addr.Port()).Equals(port) assert.String(addr.String()).Equals("v2ray.com:443")