From 150fc635c53ef552024088ac65f82522b3626808 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 3 Mar 2009 08:39:12 -0800 Subject: Automated g4 rollback of changelist 25024, plus significant hand editing. Back to T{x} for composite literals. R=r OCL=25612 CL=25632 --- src/lib/net/ip_test.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/lib/net/ip_test.go') diff --git a/src/lib/net/ip_test.go b/src/lib/net/ip_test.go index c67a7dd1b..1626f3156 100644 --- a/src/lib/net/ip_test.go +++ b/src/lib/net/ip_test.go @@ -10,7 +10,7 @@ import ( ) func ipv4(a, b, c, d byte) []byte { - return []byte( 0,0,0,0, 0,0,0,0, 0,0,255,255, a,b,c,d ) + return []byte{ 0,0,0,0, 0,0,0,0, 0,0,255,255, a,b,c,d } } func isEqual(a []byte, b []byte) bool { @@ -32,16 +32,17 @@ type parseIPTest struct { in string; out []byte; } -var parseiptests = []parseIPTest ( - parseIPTest("127.0.1.2", ipv4(127, 0, 1, 2)), - parseIPTest("127.0.0.1", ipv4(127, 0, 0, 1)), - parseIPTest("127.0.0.256", nil), - parseIPTest("abc", nil), - parseIPTest("::ffff:127.0.0.1", ipv4(127, 0, 0, 1)), - parseIPTest("2001:4860:0:2001::68", - []byte(0x20,0x01, 0x48,0x60, 0,0, 0x20,0x01, 0,0, 0,0, 0,0, 0x00,0x68)), - parseIPTest("::ffff:4a7d:1363", ipv4(74, 125, 19, 99)), -) +var parseiptests = []parseIPTest{ + parseIPTest{"127.0.1.2", ipv4(127, 0, 1, 2)}, + parseIPTest{"127.0.0.1", ipv4(127, 0, 0, 1)}, + parseIPTest{"127.0.0.256", nil}, + parseIPTest{"abc", nil}, + parseIPTest{"::ffff:127.0.0.1", ipv4(127, 0, 0, 1)}, + parseIPTest{"2001:4860:0:2001::68", + []byte{0x20,0x01, 0x48,0x60, 0,0, 0x20,0x01, + 0,0, 0,0, 0,0, 0x00,0x68}}, + parseIPTest{"::ffff:4a7d:1363", ipv4(74, 125, 19, 99)}, +} func TestParseIP(t *testing.T) { for i := 0; i < len(parseiptests); i++ { -- cgit v1.2.3