1 # This test checks that a "main" package with an external test package
2 # is recompiled only once.
3 # Verifies golang.org/issue/34321.
4
5 env GO111MODULE=off
6
7 go list -e -test -deps -f '{{if not .Standard}}{{.ImportPath}}{{end}}' pkg
8 cmp stdout want
9
10 -- $GOPATH/src/pkg/pkg.go --
11 package main
12
13 func main() {}
14
15 -- $GOPATH/src/pkg/pkg_test.go --
16 package main
17
18 import "testing"
19
20 func Test(t *testing.T) {}
21
22 -- want --
23 pkg
24 pkg [pkg.test]
25 pkg.test
26
View as plain text