3 # A test in the module's root package should work.
13 # list all should include test dependencies, like testing
14 cp go.mod.empty go.mod
18 stdout ^rsc.io/testonly$
20 # list -deps -tests should also include testing
21 # but not deps of tests of deps (rsc.io/testonly).
25 ! stdout ^rsc.io/testonly$
27 # list -test all should succeed
28 cp go.mod.empty go.mod
32 cp go.mod.empty go.mod
36 # A test with the "_test" suffix in the module root should also work.
41 # A test with the "_test" suffix of a *package* with a "_test" suffix should
42 # even work (not that you should ever do that).
52 module example.com/user/a
61 import _ "rsc.io/quote"
63 func Test(t *testing.T) {}
66 module example.com/user/b
76 func Test(t *testing.T) {}
79 module example.com/c_test
82 // Package c_test is the non-test package for its import path!
85 -- c_test/c_test_test.go --
90 func Test(t *testing.T) {}
93 // Package d is an ordinary package in a deceptively-named directory.
99 -- d_test/d_test.go --
104 func Test(t *testing.T) {}
107 module example.com/e_test
110 // Package e_test is the non-test package for its import path,
111 // in a deceptively-named directory!
119 func Test(t *testing.T) {}