summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/mod_require_exclude.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/mod_require_exclude.txt')
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_require_exclude.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/mod_require_exclude.txt b/libgo/go/cmd/go/testdata/script/mod_require_exclude.txt
new file mode 100644
index 00000000000..60f7e3fa913
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/mod_require_exclude.txt
@@ -0,0 +1,33 @@
+# build with no newer version to satisfy exclude
+env GO111MODULE=on
+! go list -m all
+stderr 'no newer version available'
+
+# build with newer version available
+cp go.mod2 go.mod
+go list -m all
+stdout 'rsc.io/quote v1.5.2'
+
+# build with excluded newer version
+cp go.mod3 go.mod
+go list -m all
+stdout 'rsc.io/quote v1.5.1'
+
+-- x.go --
+package x
+import _ "rsc.io/quote"
+
+-- go.mod --
+module x
+exclude rsc.io/sampler latest
+require rsc.io/sampler latest
+
+-- go.mod2 --
+module x
+exclude rsc.io/quote v1.5.1
+require rsc.io/quote v1.5.1
+
+-- go.mod3 --
+module x
+exclude rsc.io/quote v1.5.2
+require rsc.io/quote v1.5.1