mirror of
https://github.com/golang/go
synced 2024-11-19 07:14:45 -07:00
7b25e351ac
Support renaming of identifiers in test packages. The packages for all of the references must be checked and the changes need to be deduped, since both a package and its test package contain some of the same files. Fixes golang/go#32974 Change-Id: Ie51e19716faae77ce7e5254eeb3956faa42c2a09 Reviewed-on: https://go-review.googlesource.com/c/tools/+/185277 Run-TryBot: Suzy Mueller <suzmue@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
31 lines
427 B
Plaintext
31 lines
427 B
Plaintext
-- b-rename --
|
|
testy.go:
|
|
package testy
|
|
|
|
type tt int //@rename("tt", "testyType")
|
|
|
|
func b() {
|
|
}
|
|
|
|
testy_test.go:
|
|
package testy
|
|
|
|
import "testing"
|
|
|
|
func TestSomething(t *testing.T) {
|
|
var x int //@rename("x", "testyX")
|
|
b() //@rename("a", "b")
|
|
}
|
|
|
|
-- testyX-rename --
|
|
testy_test.go:
|
|
package testy
|
|
|
|
import "testing"
|
|
|
|
func TestSomething(t *testing.T) {
|
|
var testyX int //@rename("x", "testyX")
|
|
a() //@rename("a", "b")
|
|
}
|
|
|