5 # TODO(bcmills): Convert the 'go test' calls below to 'go list -test' once 'go
6 # list' is more sensitive to package loading errors.
8 # A test in the module's root package should work.
10 cp go.mod.empty go.mod
14 cp go.mod.empty go.mod
18 # list all should include test dependencies, like testing
19 cp go.mod.empty go.mod
23 stdout ^rsc.io/testonly$
25 # list -deps -tests should also include testing
26 # but not deps of tests of deps (rsc.io/testonly).
30 ! stdout ^rsc.io/testonly$
32 # list -test all should succeed
33 cp go.mod.empty go.mod
37 cp go.mod.empty go.mod
41 # A test with the "_test" suffix in the module root should also work.
46 # A test with the "_test" suffix of a *package* with a "_test" suffix should
47 # even work (not that you should ever do that).
61 module example.com/user/a
72 import _ "rsc.io/quote"
74 func Test(t *testing.T) {}
77 module example.com/user/b
87 func Test(t *testing.T) {}
90 module example.com/c_test
93 // Package c_test is the non-test package for its import path!
96 -- c_test/c_test_test.go --
101 func Test(t *testing.T) {}
104 // Package d is an ordinary package in a deceptively-named directory.
110 -- d_test/d_test.go --
115 func Test(t *testing.T) {}
118 module example.com/e_test
121 // Package e_test is the non-test package for its import path,
122 // in a deceptively-named directory!
130 func Test(t *testing.T) {}