summaryrefslogtreecommitdiffstats
path: root/src/cmd/go/testdata/script/version_replace.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/testdata/script/version_replace.txt')
-rw-r--r--src/cmd/go/testdata/script/version_replace.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/version_replace.txt b/src/cmd/go/testdata/script/version_replace.txt
new file mode 100644
index 0000000..ec98f4e
--- /dev/null
+++ b/src/cmd/go/testdata/script/version_replace.txt
@@ -0,0 +1,33 @@
+[short] skip
+
+go mod download example.com/printversion@v0.1.0 example.com/printversion@v1.0.0
+go get -d example.com/printversion@v0.1.0
+go install example.com/printversion
+
+go run example.com/printversion
+cmp stdout out.txt
+
+go version -m $GOPATH/bin/printversion$GOEXE
+stdout '^.*[/\\]bin[/\\]printversion'$GOEXE': .*$'
+stdout '^ path example.com/printversion$'
+stdout '^ mod example.com/printversion v0.1.0$'
+stdout '^ => example.com/printversion v1.0.0 h1:.*$'
+stdout '^ dep example.com/version v1.0.0$'
+stdout '^ => example.com/version v1.0.1 h1:.*$'
+
+-- go.mod --
+module golang.org/issue/37392
+go 1.14
+require (
+ example.com/printversion v0.1.0
+)
+replace (
+ example.com/printversion => example.com/printversion v1.0.0
+ example.com/version v1.0.0 => example.com/version v1.0.1
+)
+-- out.txt --
+path is example.com/printversion
+main is example.com/printversion v0.1.0
+ (replaced by example.com/printversion v1.0.0)
+using example.com/version v1.0.0
+ (replaced by example.com/version v1.0.1)