diff options
author | Russ Cox <rsc@golang.org> | 2009-03-03 08:39:12 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-03-03 08:39:12 -0800 |
commit | 150fc635c53ef552024088ac65f82522b3626808 (patch) | |
tree | 028f4f1a5f6b78795c1a1ef840b49c7da342edd1 /src/lib/net/ip_test.go | |
parent | 4041d184e8f1e2123b1d32d5f39190d34f50ea7e (diff) | |
download | golang-150fc635c53ef552024088ac65f82522b3626808.tar.gz |
Automated g4 rollback of changelist 25024,
plus significant hand editing.
Back to T{x} for composite literals.
R=r
OCL=25612
CL=25632
Diffstat (limited to 'src/lib/net/ip_test.go')
-rw-r--r-- | src/lib/net/ip_test.go | 23 |
1 files changed, 12 insertions, 11 deletions
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++ { |