summaryrefslogtreecommitdiff
path: root/src/cmd/fix/netudpgroup_test.go
blob: 88c0e093fc15374e53620c7a76cabe0522affe26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// 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(netudpgroupTests, netudpgroup)
}

var netudpgroupTests = []testCase{
	{
		Name: "netudpgroup.0",
		In: `package main

import "net"

func f() {
	err := x.JoinGroup(gaddr)
	err = y.LeaveGroup(gaddr)
}
`,
		Out: `package main

import "net"

func f() {
	err := x.JoinGroup(nil, gaddr)
	err = y.LeaveGroup(nil, gaddr)
}
`,
	},
	// Innocent function with no body.
	{
		Name: "netudpgroup.1",
		In: `package main

import "net"

func f()

var _ net.IP
`,
		Out: `package main

import "net"

func f()

var _ net.IP
`,
	},
}