-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: convert TestShadowingLogic to the script framework
Part of converting all tests to script framework to improve test parallelism. Updates #36320 Updates #17751 Change-Id: I6db652a4a515daf6e87645d34191dc9a441f5720 Reviewed-on: https://go-review.googlesource.com/c/go/+/214431 Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Showing
5 changed files
with
25 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
env GO111MODULE=off | ||
env GOPATH=$WORK/gopath/src/shadow/root1${:}$WORK/gopath/src/shadow/root2 | ||
|
||
# The math in root1 is not "math" because the standard math is. | ||
go list -f '({{.ImportPath}}) ({{.ConflictDir}})' ./shadow/root1/src/math | ||
stdout '^\(.*(\\|/)src(\\|/)shadow(\\|/)root1(\\|/)src(\\|/)math\) \('$GOROOT'(\\|/)?src(\\|/)math\)$' | ||
|
||
# The foo in root1 is "foo". | ||
go list -f '({{.ImportPath}}) ({{.ConflictDir}})' ./shadow/root1/src/foo | ||
stdout '^\(foo\) \(\)$' | ||
|
||
# The foo in root2 is not "foo" because the foo in root1 got there first. | ||
go list -f '({{.ImportPath}}) ({{.ConflictDir}})' ./shadow/root2/src/foo | ||
stdout '^\(.*gopath(\\|/)src(\\|/)shadow(\\|/)root2(\\|/)src(\\|/)foo\) \('$WORK'(\\|/)?gopath(\\|/)src(\\|/)shadow(\\|/)root1(\\|/)src(\\|/)foo\)$' | ||
|
||
# The error for go install should mention the conflicting directory. | ||
! go install -n ./shadow/root2/src/foo | ||
stderr 'go install: no install location for '$WORK'(\\|/)?gopath(\\|/)src(\\|/)shadow(\\|/)root2(\\|/)src(\\|/)foo: hidden by '$WORK'(\\|/)?gopath(\\|/)src(\\|/)shadow(\\|/)root1(\\|/)src(\\|/)foo' | ||
|
||
-- shadow/root1/src/foo/foo.go -- | ||
package foo | ||
-- shadow/root1/src/math/math.go -- | ||
package math | ||
-- shadow/root2/src/foo/foo.go -- | ||
package foo |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.