1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-07-26 11:44:22 -04:00

test case for ipv4 address in ipv6 format

This commit is contained in:
Darien Raymond 2016-01-21 11:51:53 +00:00
parent f60747c455
commit c78460df1e

View File

@ -41,6 +41,18 @@ func TestIPv6Address(t *testing.T) {
assert.String(addr).Equals("[102:304:102:304:102:304:102:304]")
}
func TestIPv4Asv6(t *testing.T) {
v2testing.Current(t)
ip := []byte{
byte(0), byte(0), byte(0), byte(0),
byte(0), byte(0), byte(0), byte(0),
byte(0), byte(0), byte(255), byte(255),
byte(1), byte(2), byte(3), byte(4),
}
addr := v2net.IPAddress(ip)
assert.String(addr).Equals("1.2.3.4")
}
func TestDomainAddress(t *testing.T) {
v2testing.Current(t)