Add myself to write after approval
[official-gcc.git] / libgo / go / cmd / go / testdata / script / mod_test.txt
blob76f1d7a9a4d994c20634de26305d0df2aa0ef1cb
1 env GO111MODULE=on
2 env GOFLAGS=-mod=mod
3 [short] skip
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.
9 cd a/
10 cp go.mod.empty go.mod
11 go list -test
12 ! stderr error
14 cp go.mod.empty go.mod
15 go list -deps
16 ! stdout ^testing$
18 # list all should include test dependencies, like testing
19 cp go.mod.empty go.mod
20 go list all
21 stdout ^testing$
22 stdout ^rsc.io/quote$
23 stdout ^rsc.io/testonly$
25 # list -deps -tests should also include testing
26 # but not deps of tests of deps (rsc.io/testonly).
27 go list -deps -test
28 stdout ^testing$
29 stdout ^rsc.io/quote$
30 ! stdout ^rsc.io/testonly$
32 # list -test all should succeed
33 cp go.mod.empty go.mod
34 go list -test all
35 stdout '^testing'
37 cp go.mod.empty go.mod
38 go list -test
39 ! stderr error
41 # A test with the "_test" suffix in the module root should also work.
42 cd ../b/
43 go list -test
44 ! stderr error
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).
48 cd ../c_test
49 go list -test
50 ! stderr error
52 cd ../d_test
53 go list -test
54 ! stderr error
56 cd ../e
57 go list -test
58 ! stderr error
60 -- a/go.mod.empty --
61 module example.com/user/a
63 go 1.11
65 -- a/a.go --
66 package a
68 -- a/a_test.go --
69 package a
71 import "testing"
72 import _ "rsc.io/quote"
74 func Test(t *testing.T) {}
76 -- b/go.mod --
77 module example.com/user/b
79 -- b/b.go --
80 package b
82 -- b/b_test.go --
83 package b_test
85 import "testing"
87 func Test(t *testing.T) {}
89 -- c_test/go.mod --
90 module example.com/c_test
92 -- c_test/umm.go --
93 // Package c_test is the non-test package for its import path!
94 package c_test
96 -- c_test/c_test_test.go --
97 package c_test_test
99 import "testing"
101 func Test(t *testing.T) {}
103 -- d_test/go.mod --
104 // Package d is an ordinary package in a deceptively-named directory.
105 module example.com/d
107 -- d_test/d.go --
108 package d
110 -- d_test/d_test.go --
111 package d_test
113 import "testing"
115 func Test(t *testing.T) {}
117 -- e/go.mod --
118 module example.com/e_test
120 -- e/wat.go --
121 // Package e_test is the non-test package for its import path,
122 // in a deceptively-named directory!
123 package e_test
125 -- e/e_test.go --
126 package e_test_test
128 import "testing"
130 func Test(t *testing.T) {}