From: Bryan C. Mills Date: Thu, 29 Oct 2020 20:06:19 +0000 (-0400) Subject: cmd/go: make TestScript/mod_get_patchmod self-contained X-Git-Tag: go1.16beta1~388 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8494a6243ee5c80da51da8f4e1ad4d719eddf409;p=gostls13.git cmd/go: make TestScript/mod_get_patchmod self-contained I find it pretty difficult to reason about test-dependency modules when they aren't in the same file as the rest of the test. Now that 'go get' supports replacements (CL 258220 and CL 266018), we can localize tests that need 'go get' but don't specifically depend on module proxy semantics. For #36460 For #37438 Change-Id: Ib37a6c170f251435399dfc23e60d96681a81eadc Reviewed-on: https://go-review.googlesource.com/c/go/+/266369 Trust: Bryan C. Mills Run-TryBot: Bryan C. Mills Reviewed-by: Jay Conrod Reviewed-by: Michael Matloob TryBot-Result: Go Bot --- diff --git a/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.1.0.txt b/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.1.0.txt deleted file mode 100644 index f5e76b00c9..0000000000 --- a/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.1.0.txt +++ /dev/null @@ -1,16 +0,0 @@ -Written by hand. -Test module with a root package added in v0.1.0 and removed in v0.2.0. - --- .mod -- -module example.net/pkgremoved - -go 1.16 --- .info -- -{"Version": "v0.1.0"} --- go.mod -- -module example.net/pkgremoved - -go 1.16 --- pkgremoved.go -- -// Package pkgremoved exists in v0.1.0. -package pkgremoved diff --git a/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.0.txt b/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.0.txt deleted file mode 100644 index f1fc9fb61f..0000000000 --- a/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.0.txt +++ /dev/null @@ -1,15 +0,0 @@ -Written by hand. -Test module with a root package added in v0.1.0 and removed in v0.2.0. - --- .mod -- -module example.net/pkgremoved - -go 1.16 --- .info -- -{"Version": "v0.2.0"} --- go.mod -- -module example.net/pkgremoved - -go 1.16 --- README.txt -- -Package pkgremove was removed in v0.2.0. diff --git a/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.1.txt b/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.1.txt deleted file mode 100644 index 0e961853d5..0000000000 --- a/src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.1.txt +++ /dev/null @@ -1,15 +0,0 @@ -Written by hand. -Test module with a root package added in v0.1.0 and removed in v0.2.0. - --- .mod -- -module example.net/pkgremoved - -go 1.16 --- .info -- -{"Version": "v0.2.1"} --- go.mod -- -module example.net/pkgremoved - -go 1.16 --- README.txt -- -Package pkgremove was removed in v0.2.0. diff --git a/src/cmd/go/testdata/script/mod_get_patchmod.txt b/src/cmd/go/testdata/script/mod_get_patchmod.txt index 45d680d021..0f4e2e1647 100644 --- a/src/cmd/go/testdata/script/mod_get_patchmod.txt +++ b/src/cmd/go/testdata/script/mod_get_patchmod.txt @@ -17,7 +17,7 @@ stdout '^example.net/pkgremoved' ! go get -d example.net/pkgremoved@patch example.net/other@v0.1.0 -stderr '^go get example.net/pkgremoved@patch: module example.net/pkgremoved@latest found \(v0.2.1\), but does not contain package example.net/pkgremoved$' +stderr '^go get example.net/pkgremoved@patch: module example.net/pkgremoved@latest found \(v0.2.1, replaced by ./pr2\), but does not contain package example.net/pkgremoved$' -- go.mod -- @@ -27,6 +27,10 @@ go 1.16 replace ( example.net/other v0.1.0 => ./other + example.net/pkgremoved v0.1.0 => ./pr1 + example.net/pkgremoved v0.1.1 => ./pr1 + example.net/pkgremoved v0.2.0 => ./pr2 + example.net/pkgremoved v0.2.1 => ./pr2 ) -- other/go.mod -- module example.net/other @@ -36,3 +40,13 @@ go 1.16 require example.net/pkgremoved v0.2.0 -- other/other.go -- package other +-- pr1/go.mod -- +module example.net/pkgremoved + +go 1.16 +-- pr1/pkgremoved.go -- +package pkgremoved +-- pr2/go.mod -- +module example.net/pkgremoved +-- pr2/README.txt -- +Package pkgremoved was removed in v0.2.0.