This test passes, but it encodes several behaviors that I think are bugs.
I suggest that we check it in as-is, and we can update it as the bugs are fixed.
Change-Id: Icb073de9cb13036dbccadb4ff2cb3169ffb56236
Reviewed-on: https://go-review.googlesource.com/128137
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
--- /dev/null
+research.swtch.com/vgo-tour@v1.0.0
+
+-- .mod --
+module "research.swtch.com/vgo-tour"
+-- .info --
+{"Version":"v1.0.0","Name":"84de74b35823c1e49634f2262f1a58cfc951ebae","Short":"84de74b35823","Time":"2018-02-20T00:04:00Z"}
+-- go.mod --
+module "research.swtch.com/vgo-tour"
+-- hello.go --
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "fmt"
+ "rsc.io/quote"
+)
+
+func main() {
+ fmt.Println(quote.Hello())
+}
go get -x golang.org/x/text/language@14c0d48
stderr 'compile|cp|gccgo .*language\.a$'
+# BUG: after the build, the package should not be stale, as 'go install' would
+# not do anything further.
+go list -f '{{.Stale}}' golang.org/x/text/language
+stdout ^true
+
+# install after get should not run the compiler again.
+go install -x golang.org/x/text/language
+! stderr 'compile|cp|gccgo .*language\.a$'
+
# even with -d, we should see an error for unknown packages.
! go get -d -x golang.org/x/text/foo@14c0d48
--- /dev/null
+env GO111MODULE=on
+
+go mod init example.com/m
+
+# get of a binary should install it to $GOPATH/bin
+# BUG: vgo-tour should be installed as vgo-tour, not vgo-tour@v1.0.0.
+go get research.swtch.com/vgo-tour
+exec $GOPATH/bin/vgo-tour@v1.0.0
+stdout 'Hello, world.'
+rm $GOPATH/bin/vgo-tour@v1.0.0
+
+# install of a binary should install it to $GOPATH/bin
+# BUG: vgo-tour should be installed as vgo-tour, not vgo-tour@v1.0.0.
+go install research.swtch.com/vgo-tour
+exec $GOPATH/bin/vgo-tour@v1.0.0
+stdout 'Hello, world.'