1 env GO111MODULE=on
2
3 # go list -compiled -test must handle test-only packages
4 # golang.org/issue/27097.
5 go list -compiled -test
6 stdout -count=4 '^.' # 4 lines
7 stdout '^m$'
8 stdout '^m\.test$'
9 stdout '^m \[m\.test\]$'
10 stdout '^m_test \[m\.test\]$'
11
12 # https://golang.org/issue/39974: test packages should have the Module field populated.
13 go list -test -f '{{.ImportPath}}{{with .Module}}: {{.Path}}{{end}}'
14 stdout -count=4 '^.' # 4 lines
15 stdout '^m: m$'
16 stdout '^m\.test: m$'
17 stdout '^m \[m\.test\]: m$'
18 stdout '^m_test \[m\.test\]: m$'
19
20 -- go.mod --
21 module m
22
23 -- x_test.go --
24 package x
25 import "testing"
26 func Test(t *testing.T) {}
27 -- x_x_test.go --
28 package x_test
29 import "testing"
30 func Test(t *testing.T) {}
31
View as plain text