Skip to content

Commit 8494a62

Browse files
author
Bryan C. Mills
committed
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 <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Michael Matloob <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 36d412f commit 8494a62

File tree

4 files changed

+15
-47
lines changed

4 files changed

+15
-47
lines changed

src/cmd/go/testdata/mod/example.net_pkgremoved_v0.1.0.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.0.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/cmd/go/testdata/mod/example.net_pkgremoved_v0.2.1.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/cmd/go/testdata/script/mod_get_patchmod.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ stdout '^example.net/pkgremoved'
1717

1818
! go get -d example.net/pkgremoved@patch example.net/[email protected]
1919

20-
stderr '^go get example.net/pkgremoved@patch: module example.net/pkgremoved@latest found \(v0.2.1\), but does not contain package example.net/pkgremoved$'
20+
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$'
2121

2222

2323
-- go.mod --
@@ -27,6 +27,10 @@ go 1.16
2727

2828
replace (
2929
example.net/other v0.1.0 => ./other
30+
example.net/pkgremoved v0.1.0 => ./pr1
31+
example.net/pkgremoved v0.1.1 => ./pr1
32+
example.net/pkgremoved v0.2.0 => ./pr2
33+
example.net/pkgremoved v0.2.1 => ./pr2
3034
)
3135
-- other/go.mod --
3236
module example.net/other
@@ -36,3 +40,13 @@ go 1.16
3640
require example.net/pkgremoved v0.2.0
3741
-- other/other.go --
3842
package other
43+
-- pr1/go.mod --
44+
module example.net/pkgremoved
45+
46+
go 1.16
47+
-- pr1/pkgremoved.go --
48+
package pkgremoved
49+
-- pr2/go.mod --
50+
module example.net/pkgremoved
51+
-- pr2/README.txt --
52+
Package pkgremoved was removed in v0.2.0.

0 commit comments

Comments
 (0)