From b39e15dde5ec7b96c15da9faf4ab5892501c1aae Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 23 Mar 2013 11:28:53 +0100 Subject: Imported Upstream version 1.1~hg20130323 --- src/cmd/fix/netipv6zone_test.go | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'src/cmd/fix/netipv6zone_test.go') diff --git a/src/cmd/fix/netipv6zone_test.go b/src/cmd/fix/netipv6zone_test.go index 229daa386..0fab00531 100644 --- a/src/cmd/fix/netipv6zone_test.go +++ b/src/cmd/fix/netipv6zone_test.go @@ -15,36 +15,24 @@ var netipv6zoneTests = []testCase{ import "net" -var a = []struct { - *net.IPNet -}{ - &net.IPNet{net.ParseIP("2001:DB8::"), net.IPMask(net.ParseIP("ffff:ffff:ffff::"))}, -} - func f() net.Addr { - b := net.IPNet{net.IPv4(127, 0, 0, 1), net.IPv4Mask(255, 0, 0, 0)} - c := &net.IPAddr{ip1} + a := &net.IPAddr{ip1} sub(&net.UDPAddr{ip2, 12345}) - d := &net.TCPAddr{IP: ip3, Port: 54321} - return &net.TCPAddr{ip4}, nil + c := &net.TCPAddr{IP: ip3, Port: 54321} + d := &net.TCPAddr{ip4, 0} + return &net.TCPAddr{ip5}, nil } `, Out: `package main import "net" -var a = []struct { - *net.IPNet -}{ - &net.IPNet{IP: net.ParseIP("2001:DB8::"), Mask: net.IPMask(net.ParseIP("ffff:ffff:ffff::"))}, -} - func f() net.Addr { - b := net.IPNet{IP: net.IPv4(127, 0, 0, 1), Mask: net.IPv4Mask(255, 0, 0, 0)} - c := &net.IPAddr{IP: ip1} + a := &net.IPAddr{IP: ip1} sub(&net.UDPAddr{IP: ip2, Port: 12345}) - d := &net.TCPAddr{IP: ip3, Port: 54321} - return &net.TCPAddr{IP: ip4}, nil + c := &net.TCPAddr{IP: ip3, Port: 54321} + d := &net.TCPAddr{IP: ip4} + return &net.TCPAddr{IP: ip5}, nil } `, }, -- cgit v1.2.3