mirror of https://github.com/v2ray/v2ray-core
more tests on address
parent
f9b31afa48
commit
80c5e1973c
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue