more tests on address

pull/18/head
V2Ray 2015-09-16 22:24:04 +02:00
parent f9b31afa48
commit 80c5e1973c
1 changed files with 3 additions and 0 deletions

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")
}