summaryrefslogtreecommitdiff
path: root/src/cmd/fix/netdial_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/fix/netdial_test.go')
-rw-r--r--src/cmd/fix/netdial_test.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/cmd/fix/netdial_test.go b/src/cmd/fix/netdial_test.go
new file mode 100644
index 000000000..fff00b4ad
--- /dev/null
+++ b/src/cmd/fix/netdial_test.go
@@ -0,0 +1,57 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+ addTestCases(netdialTests, nil)
+}
+
+var netdialTests = []testCase{
+ {
+ Name: "netdial.0",
+ Fn: netdial,
+ In: `package main
+
+import "net"
+
+func f() {
+ c, err := net.Dial(net, "", addr)
+ c, err = net.Dial(net, "", addr)
+}
+`,
+ Out: `package main
+
+import "net"
+
+func f() {
+ c, err := net.Dial(net, addr)
+ c, err = net.Dial(net, addr)
+}
+`,
+ },
+
+ {
+ Name: "netlookup.0",
+ Fn: netlookup,
+ In: `package main
+
+import "net"
+
+func f() {
+ foo, bar, _ := net.LookupHost(host)
+ foo, bar, _ = net.LookupHost(host)
+}
+`,
+ Out: `package main
+
+import "net"
+
+func f() {
+ foo, bar := net.LookupHost(host)
+ foo, bar = net.LookupHost(host)
+}
+`,
+ },
+}