summaryrefslogtreecommitdiff
path: root/src/cmd/fix/httputil_test.go
blob: 83e9f6dfb381d20a54b2d5a5ad50f81f0c8e2406 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// 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(httputilTests, httputil)
}

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

import "net/http"

func f() {
	http.DumpRequest(nil, false)
	http.DumpRequestOut(nil, false)
	http.DumpResponse(nil, false)
	http.NewChunkedReader(nil)
	http.NewChunkedWriter(nil)
	http.NewClientConn(nil, nil)
	http.NewProxyClientConn(nil, nil)
	http.NewServerConn(nil, nil)
	http.NewSingleHostReverseProxy(nil)
}
`,
		Out: `package main

import "net/http/httputil"

func f() {
	httputil.DumpRequest(nil, false)
	httputil.DumpRequestOut(nil, false)
	httputil.DumpResponse(nil, false)
	httputil.NewChunkedReader(nil)
	httputil.NewChunkedWriter(nil)
	httputil.NewClientConn(nil, nil)
	httputil.NewProxyClientConn(nil, nil)
	httputil.NewServerConn(nil, nil)
	httputil.NewSingleHostReverseProxy(nil)
}
`,
	},
	{
		Name: "httputil.1",
		In: `package main

import "net/http"

func f() {
	http.DumpRequest(nil, false)
	http.DumpRequestOut(nil, false)
	http.DumpResponse(nil, false)
	http.NewChunkedReader(nil)
	http.NewChunkedWriter(nil)
	http.NewClientConn(nil, nil)
	http.NewProxyClientConn(nil, nil)
	http.NewServerConn(nil, nil)
	http.NewSingleHostReverseProxy(nil)
}
`,
		Out: `package main

import "net/http/httputil"

func f() {
	httputil.DumpRequest(nil, false)
	httputil.DumpRequestOut(nil, false)
	httputil.DumpResponse(nil, false)
	httputil.NewChunkedReader(nil)
	httputil.NewChunkedWriter(nil)
	httputil.NewClientConn(nil, nil)
	httputil.NewProxyClientConn(nil, nil)
	httputil.NewServerConn(nil, nil)
	httputil.NewSingleHostReverseProxy(nil)
}
`,
	},
	{
		Name: "httputil.2",
		In: `package main

import "net/http"

func f() {
	http.DumpRequest(nil, false)
	http.DumpRequestOut(nil, false)
	http.DumpResponse(nil, false)
	http.NewChunkedReader(nil)
	http.NewChunkedWriter(nil)
	http.NewClientConn(nil, nil)
	http.NewProxyClientConn(nil, nil)
	http.NewServerConn(nil, nil)
	http.NewSingleHostReverseProxy(nil)
	http.Get("")
}
`,
		Out: `package main

import (
	"net/http"
	"net/http/httputil"
)

func f() {
	httputil.DumpRequest(nil, false)
	httputil.DumpRequestOut(nil, false)
	httputil.DumpResponse(nil, false)
	httputil.NewChunkedReader(nil)
	httputil.NewChunkedWriter(nil)
	httputil.NewClientConn(nil, nil)
	httputil.NewProxyClientConn(nil, nil)
	httputil.NewServerConn(nil, nil)
	httputil.NewSingleHostReverseProxy(nil)
	http.Get("")
}
`,
	},
}