summaryrefslogtreecommitdiff
path: root/src/cmd/gofix/go1pkgrename_test.go
blob: 464d67e7f0b91890a89f665e219f64459710398f (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
// 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(go1renameTests, go1pkgrename)
}

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

import (
	"asn1"
	"big"
	"cmath"
	"csv"
	"exec"
	"exp/template/html"
	"gob"
	"http"
	"http/cgi"
	"http/fcgi"
	"http/httptest"
	"http/pprof"
	"json"
	"mail"
	"rand"
	"rpc"
	"rpc/jsonrpc"
	"scanner"
	"smtp"
	"syslog"
	"tabwriter"
	"template"
	"template/parse"
	"url"
	"utf16"
	"utf8"
	"xml"
)
`,
		Out: `package main

import (
	"encoding/asn1"
	"encoding/csv"
	"encoding/gob"
	"encoding/json"
	"encoding/xml"
	"html/template"
	"log/syslog"
	"math/big"
	"math/cmplx"
	"math/rand"
	"net/http"
	"net/http/cgi"
	"net/http/fcgi"
	"net/http/httptest"
	"net/http/pprof"
	"net/mail"
	"net/rpc"
	"net/rpc/jsonrpc"
	"net/smtp"
	"net/url"
	"os/exec"
	"text/scanner"
	"text/tabwriter"
	"text/template"
	"text/template/parse"
	"unicode/utf16"
	"unicode/utf8"
)
`,
	},
	{
		Name: "go1rename.1",
		In: `package main

import "cmath"
import poot "exp/template/html"

var _ = cmath.Sin
var _ = poot.Poot
`,
		Out: `package main

import "math/cmplx"
import poot "html/template"

var _ = cmplx.Sin
var _ = poot.Poot
`,
	},
}