From c78460df1e6168c05124905e04142dc5aa916ae4 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Thu, 21 Jan 2016 11:51:53 +0000 Subject: [PATCH] test case for ipv4 address in ipv6 format --- common/net/address_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/net/address_test.go b/common/net/address_test.go index f8ac60630..03152c5dd 100644 --- a/common/net/address_test.go +++ b/common/net/address_test.go @@ -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)