aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_update_sum_readonly.txt
diff options
context:
space:
mode:
authorGerrit Code Review <noreply-gerritcodereview@google.com>2021-08-12 20:22:27 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-08-12 20:22:27 +0000
commit4d3cc84774549d26e52cbba3a0ffc50d3ede80d5 (patch)
treede3466e3b835e2c18fa03548ddf0619f5555575b /src/cmd/go/testdata/script/mod_update_sum_readonly.txt
parent7e9f911ec4fd08ce9b4296f0aea4864b53064573 (diff)
parenta64ab8d3ecb38e10007e136edc9dc3abde873e1e (diff)
downloadgo-4d3cc84774549d26e52cbba3a0ffc50d3ede80d5.tar.gz
go-4d3cc84774549d26e52cbba3a0ffc50d3ede80d5.zip
Merge "[dev.typeparams] all: merge master (46fd547) into dev.typeparams" into dev.typeparamsdev.typeparams
Diffstat (limited to 'src/cmd/go/testdata/script/mod_update_sum_readonly.txt')
-rw-r--r--src/cmd/go/testdata/script/mod_update_sum_readonly.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/mod_update_sum_readonly.txt b/src/cmd/go/testdata/script/mod_update_sum_readonly.txt
new file mode 100644
index 0000000000..41f12e4084
--- /dev/null
+++ b/src/cmd/go/testdata/script/mod_update_sum_readonly.txt
@@ -0,0 +1,34 @@
+# When finding the latest version of a module, we should not download version
+# contents. Previously, we downloaded .zip files to determine whether a real
+# .mod file was present in order to decide whether +incompatible versions
+# could be "latest".
+#
+# Verifies #47377.
+
+# rsc.io/breaker has two versions, neither of which has a .mod file.
+go list -m -versions rsc.io/breaker
+stdout '^rsc.io/breaker v1.0.0 v2.0.0\+incompatible$'
+go mod download rsc.io/breaker@v1.0.0
+! grep '^go' $GOPATH/pkg/mod/cache/download/rsc.io/breaker/@v/v1.0.0.mod
+go mod download rsc.io/breaker@v2.0.0+incompatible
+! grep '^go' $GOPATH/pkg/mod/cache/download/rsc.io/breaker/@v/v2.0.0+incompatible.mod
+
+# Delete downloaded .zip files.
+go clean -modcache
+
+# Check for updates.
+go list -m -u rsc.io/breaker
+stdout '^rsc.io/breaker v1.0.0 \[v2.0.0\+incompatible\]$'
+
+# We should not have downloaded zips.
+! exists $GOPATH/pkg/mod/cache/download/rsc.io/breaker/@v/v1.0.0.zip
+! exists $GOPATH/pkg/mod/cache/download/rsc.io/breaker/@v/v2.0.0+incompatible.zip
+
+-- go.mod --
+module m
+
+go 1.16
+
+require rsc.io/breaker v1.0.0
+-- go.sum --
+rsc.io/breaker v1.0.0/go.mod h1:s5yxDXvD88U1/ESC23I2FK3Lkv4YIKaB1ij/Hbm805g=