~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2012 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(go1renameTests, go1renameFix.f)
9
 
}
10
 
 
11
 
var go1renameTests = []testCase{
12
 
        {
13
 
                Name: "go1rename.0",
14
 
                In: `package main
15
 
 
16
 
import (
17
 
        "crypto/aes"
18
 
        "crypto/des"
19
 
        "encoding/json"
20
 
        "net/http"
21
 
        "net/url"
22
 
        "os"
23
 
        "runtime"
24
 
)
25
 
 
26
 
var (
27
 
        _ *aes.Cipher
28
 
        _ *des.Cipher
29
 
        _ *des.TripleDESCipher
30
 
        _ = json.MarshalForHTML
31
 
        _ = aes.New()
32
 
        _ = url.Parse
33
 
        _ = url.ParseWithReference
34
 
        _ = url.ParseRequest
35
 
        _ = os.Exec
36
 
        _ = runtime.Cgocalls
37
 
        _ = runtime.Goroutines
38
 
        _ = http.ErrPersistEOF
39
 
        _ = http.ErrPipeline
40
 
        _ = http.ErrClosed
41
 
        _ = http.NewSingleHostReverseProxy
42
 
        _ = http.NewChunkedReader
43
 
        _ = http.NewChunkedWriter
44
 
        _ *http.ReverseProxy
45
 
        _ *http.ClientConn
46
 
        _ *http.ServerConn
47
 
)
48
 
`,
49
 
                Out: `package main
50
 
 
51
 
import (
52
 
        "crypto/aes"
53
 
        "crypto/cipher"
54
 
        "encoding/json"
55
 
        "net/http/httputil"
56
 
        "net/url"
57
 
        "runtime"
58
 
        "syscall"
59
 
)
60
 
 
61
 
var (
62
 
        _ cipher.Block
63
 
        _ cipher.Block
64
 
        _ cipher.Block
65
 
        _ = json.Marshal
66
 
        _ = aes.New()
67
 
        _ = url.Parse
68
 
        _ = url.Parse
69
 
        _ = url.ParseRequestURI
70
 
        _ = syscall.Exec
71
 
        _ = runtime.NumCgoCall
72
 
        _ = runtime.NumGoroutine
73
 
        _ = httputil.ErrPersistEOF
74
 
        _ = httputil.ErrPipeline
75
 
        _ = httputil.ErrClosed
76
 
        _ = httputil.NewSingleHostReverseProxy
77
 
        _ = httputil.NewChunkedReader
78
 
        _ = httputil.NewChunkedWriter
79
 
        _ *httputil.ReverseProxy
80
 
        _ *httputil.ClientConn
81
 
        _ *httputil.ServerConn
82
 
)
83
 
`,
84
 
        },
85
 
        {
86
 
                Name: "httputil.0",
87
 
                In: `package main
88
 
 
89
 
import "net/http"
90
 
 
91
 
func f() {
92
 
        http.DumpRequest(nil, false)
93
 
        http.DumpRequestOut(nil, false)
94
 
        http.DumpResponse(nil, false)
95
 
        http.NewChunkedReader(nil)
96
 
        http.NewChunkedWriter(nil)
97
 
        http.NewClientConn(nil, nil)
98
 
        http.NewProxyClientConn(nil, nil)
99
 
        http.NewServerConn(nil, nil)
100
 
        http.NewSingleHostReverseProxy(nil)
101
 
}
102
 
`,
103
 
                Out: `package main
104
 
 
105
 
import "net/http/httputil"
106
 
 
107
 
func f() {
108
 
        httputil.DumpRequest(nil, false)
109
 
        httputil.DumpRequestOut(nil, false)
110
 
        httputil.DumpResponse(nil, false)
111
 
        httputil.NewChunkedReader(nil)
112
 
        httputil.NewChunkedWriter(nil)
113
 
        httputil.NewClientConn(nil, nil)
114
 
        httputil.NewProxyClientConn(nil, nil)
115
 
        httputil.NewServerConn(nil, nil)
116
 
        httputil.NewSingleHostReverseProxy(nil)
117
 
}
118
 
`,
119
 
        },
120
 
        {
121
 
                Name: "httputil.1",
122
 
                In: `package main
123
 
 
124
 
import "net/http"
125
 
 
126
 
func f() {
127
 
        http.DumpRequest(nil, false)
128
 
        http.DumpRequestOut(nil, false)
129
 
        http.DumpResponse(nil, false)
130
 
        http.NewChunkedReader(nil)
131
 
        http.NewChunkedWriter(nil)
132
 
        http.NewClientConn(nil, nil)
133
 
        http.NewProxyClientConn(nil, nil)
134
 
        http.NewServerConn(nil, nil)
135
 
        http.NewSingleHostReverseProxy(nil)
136
 
}
137
 
`,
138
 
                Out: `package main
139
 
 
140
 
import "net/http/httputil"
141
 
 
142
 
func f() {
143
 
        httputil.DumpRequest(nil, false)
144
 
        httputil.DumpRequestOut(nil, false)
145
 
        httputil.DumpResponse(nil, false)
146
 
        httputil.NewChunkedReader(nil)
147
 
        httputil.NewChunkedWriter(nil)
148
 
        httputil.NewClientConn(nil, nil)
149
 
        httputil.NewProxyClientConn(nil, nil)
150
 
        httputil.NewServerConn(nil, nil)
151
 
        httputil.NewSingleHostReverseProxy(nil)
152
 
}
153
 
`,
154
 
        },
155
 
        {
156
 
                Name: "httputil.2",
157
 
                In: `package main
158
 
 
159
 
import "net/http"
160
 
 
161
 
func f() {
162
 
        http.DumpRequest(nil, false)
163
 
        http.DumpRequestOut(nil, false)
164
 
        http.DumpResponse(nil, false)
165
 
        http.NewChunkedReader(nil)
166
 
        http.NewChunkedWriter(nil)
167
 
        http.NewClientConn(nil, nil)
168
 
        http.NewProxyClientConn(nil, nil)
169
 
        http.NewServerConn(nil, nil)
170
 
        http.NewSingleHostReverseProxy(nil)
171
 
        http.Get("")
172
 
}
173
 
`,
174
 
                Out: `package main
175
 
 
176
 
import (
177
 
        "net/http"
178
 
        "net/http/httputil"
179
 
)
180
 
 
181
 
func f() {
182
 
        httputil.DumpRequest(nil, false)
183
 
        httputil.DumpRequestOut(nil, false)
184
 
        httputil.DumpResponse(nil, false)
185
 
        httputil.NewChunkedReader(nil)
186
 
        httputil.NewChunkedWriter(nil)
187
 
        httputil.NewClientConn(nil, nil)
188
 
        httputil.NewProxyClientConn(nil, nil)
189
 
        httputil.NewServerConn(nil, nil)
190
 
        httputil.NewSingleHostReverseProxy(nil)
191
 
        http.Get("")
192
 
}
193
 
`,
194
 
        },
195
 
}