...
Run Format

Text file src/cmd/go/testdata/script/list_test.txt

Documentation: cmd/go/testdata/script

     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
     7go list -test -deps bytes
     8stdout '^bytes.test$' # test main
     9stdout '^bytes$' # real bytes
    10stdout '^bytes \[bytes.test\]$' # test copy of bytes
    11stdout 'testing \[bytes.test\]$' # test copy of testing
    12! stdout ^testing$ # should not have real testing
    13
    14go list -test bytes
    15stdout '^bytes.test$' # test main
    16stdout '^bytes$' # real bytes
    17stdout '^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
    21go list -test cmd/buildid cmd/gofmt
    22stdout '^cmd/buildid$' # cmd/buildid
    23stdout '^cmd/gofmt$' # cmd/gofmt
    24stdout '^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
    28go list -test runtime/cgo
    29stdout '^runtime/cgo$' # runtime/cgo
    30
    31go list -deps -f '{{if .DepOnly}}{{.ImportPath}}{{end}}' sort
    32stdout '^internal/reflectlite$' # internal/reflectlite
    33! stdout '^sort' # should not have sort

View as plain text