~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/cmd/fix/netdial_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 The Go Authors. All rights reserved.
2
 
// Use of this source code is governed by a BSD-style
3
 
// license that can be found in the LICENSE file.
4
 
 
5
 
package main
6
 
 
7
 
func init() {
8
 
        addTestCases(netdialTests, nil)
9
 
}
10
 
 
11
 
var netdialTests = []testCase{
12
 
        {
13
 
                Name: "netdial.0",
14
 
                Fn:   netdial,
15
 
                In: `package main
16
 
 
17
 
import "net"
18
 
 
19
 
func f() {
20
 
        c, err := net.Dial(net, "", addr)
21
 
        c, err = net.Dial(net, "", addr)
22
 
}
23
 
`,
24
 
                Out: `package main
25
 
 
26
 
import "net"
27
 
 
28
 
func f() {
29
 
        c, err := net.Dial(net, addr)
30
 
        c, err = net.Dial(net, addr)
31
 
}
32
 
`,
33
 
        },
34
 
 
35
 
        {
36
 
                Name: "netlookup.0",
37
 
                Fn:   netlookup,
38
 
                In: `package main
39
 
 
40
 
import "net"
41
 
 
42
 
func f() {
43
 
        foo, bar, _ := net.LookupHost(host)
44
 
        foo, bar, _ = net.LookupHost(host)
45
 
}
46
 
`,
47
 
                Out: `package main
48
 
 
49
 
import "net"
50
 
 
51
 
func f() {
52
 
        foo, bar := net.LookupHost(host)
53
 
        foo, bar = net.LookupHost(host)
54
 
}
55
 
`,
56
 
        },
57
 
}