mirror of
https://github.com/golang/go
synced 2024-11-23 07:30:05 -07:00
cmd/go: convert TestGoGetNonPkg to the script framework
Part of converting all tests to script framework to improve test parallelism. Updates #36320 Updates #17751 Change-Id: Ieaddc20aebd0b71189f2ebc8f8e2758f1117bbed Reviewed-on: https://go-review.googlesource.com/c/go/+/213826 Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
a737299f38
commit
0119933477
@ -1204,23 +1204,6 @@ func TestPackageNotStaleWithTrailingSlash(t *testing.T) {
|
||||
tg.wantNotStale("io", "", "with trailing slash in GOROOT, io listed as stale")
|
||||
}
|
||||
|
||||
func TestGoGetNonPkg(t *testing.T) {
|
||||
testenv.MustHaveExternalNetwork(t)
|
||||
testenv.MustHaveExecPath(t, "git")
|
||||
|
||||
tg := testgo(t)
|
||||
defer tg.cleanup()
|
||||
tg.tempDir("gobin")
|
||||
tg.setenv("GOPATH", tg.path("."))
|
||||
tg.setenv("GOBIN", tg.path("gobin"))
|
||||
tg.runFail("get", "-d", "golang.org/x/tools")
|
||||
tg.grepStderr("golang.org/x/tools: no Go files", "missing error")
|
||||
tg.runFail("get", "-d", "-u", "golang.org/x/tools")
|
||||
tg.grepStderr("golang.org/x/tools: no Go files", "missing error")
|
||||
tg.runFail("get", "-d", "golang.org/x/tools")
|
||||
tg.grepStderr("golang.org/x/tools: no Go files", "missing error")
|
||||
}
|
||||
|
||||
func TestGoGetTestOnlyPkg(t *testing.T) {
|
||||
testenv.MustHaveExternalNetwork(t)
|
||||
testenv.MustHaveExecPath(t, "git")
|
||||
|
14
src/cmd/go/testdata/script/get_non_pkg.txt
vendored
Normal file
14
src/cmd/go/testdata/script/get_non_pkg.txt
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
[!net] skip
|
||||
[!exec:git] skip
|
||||
|
||||
env GOBIN=$WORK/tmp/gobin
|
||||
env GO111MODULE=off
|
||||
|
||||
! go get -d golang.org/x/tools
|
||||
stderr 'golang.org/x/tools: no Go files'
|
||||
|
||||
! go get -d -u golang.org/x/tools
|
||||
stderr 'golang.org/x/tools: no Go files'
|
||||
|
||||
! go get -d golang.org/x/tools
|
||||
stderr 'golang.org/x/tools: no Go files'
|
Loading…
Reference in New Issue
Block a user