summaryrefslogtreecommitdiff
path: root/src/cmd/fix/go1rename_test.go
blob: 02eaea6a541965bdf79bbda27eb30588e89b0d39 (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
// Copyright 2012 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, go1renameFix.f)
}

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

import (
	"crypto/aes"
	"crypto/des"
	"net/url"
	"os"
	"runtime"
)

var (
	_ *aes.Cipher
	_ *des.Cipher
	_ *des.TripleDESCipher
	_ = aes.New()
	_ = url.Parse
	_ = url.ParseWithReference
	_ = url.ParseRequest
	_ = os.Exec
	_ = runtime.Cgocalls
	_ = runtime.Goroutines
)
`,
		Out: `package main

import (
	"crypto/aes"
	"crypto/cipher"
	"net/url"
	"runtime"
	"syscall"
)

var (
	_ cipher.Block
	_ cipher.Block
	_ cipher.Block
	_ = aes.New()
	_ = url.Parse
	_ = url.Parse
	_ = url.ParseRequestURI
	_ = syscall.Exec
	_ = runtime.NumCgoCall
	_ = runtime.NumGoroutine
)
`,
	},
}