| 1 |
# This is a script test conversion of TestGoListTest which was added in |
| 2 |
# CL 107916, which added support for go list -test. |
| 3 |
# Test the behavior of go list -test. |
| 4 |
|
| 5 |
[compiler:gccgo] skip 'gccgo does not have standard packages' |
| 6 |
|
| 7 |
go list -test -deps bytes |
| 8 |
stdout '^bytes.test$' # test main |
| 9 |
stdout '^bytes$' # real bytes |
| 10 |
stdout '^bytes \[bytes.test\]$' # test copy of bytes |
| 11 |
stdout 'testing \[bytes.test\]$' # test copy of testing |
| 12 |
! stdout ^testing$ # should not have real testing |
| 13 |
|
| 14 |
go list -test bytes |
| 15 |
stdout '^bytes.test$' # test main |
| 16 |
stdout '^bytes$' # real bytes |
| 17 |
stdout '^bytes \[bytes.test\]$' # test copy of bytes |
| 18 |
! stdout '^testing \[bytes.test\]$' # should not have test copy of testing |
| 19 |
! stdout '^testing$' # should not have real testing |
| 20 |
|
| 21 |
go list -test cmd/buildid cmd/gofmt |
| 22 |
stdout '^cmd/buildid$' # cmd/buildid |
| 23 |
stdout '^cmd/gofmt$' # cmd/gofmt |
| 24 |
stdout '^cmd/gofmt\.test$' # cmd/gofmt test |
| 25 |
! stdout '^cmd/buildid\.test$' # should not have cmd/buildid test |
| 26 |
! stdout '^testing' # should not have real testing |
| 27 |
|
| 28 |
go list -test runtime/cgo |
| 29 |
stdout '^runtime/cgo$' # runtime/cgo |
| 30 |
|
| 31 |
go list -deps -f '{{if .DepOnly}}{{.ImportPath}}{{end}}' sort |
| 32 |
stdout '^internal/reflectlite$' # internal/reflectlite |
| 33 |
! stdout '^sort' # should not have sort |