1
0
mirror of https://github.com/golang/go synced 2024-11-23 13:00:07 -07:00

cmd/go: convert TestNonCanonicalImportPaths to a script test

This test failed in a pending CL, and I would rather debug it as a script.

Change-Id: I231367c86415ab61d0f9e08b88c9546d32b373b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/206498
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Bryan C. Mills 2019-11-11 16:46:27 -05:00
parent 49ac23a3cf
commit c32aab31b1
6 changed files with 21 additions and 21 deletions

View File

@ -1436,17 +1436,6 @@ func TestRelativeImportsInCommandLinePackage(t *testing.T) {
tg.run(append([]string{"test"}, files...)...)
}
func TestNonCanonicalImportPaths(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
tg.parallel()
tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
tg.runFail("build", "canonical/d")
tg.grepStderr("package canonical/d", "did not report canonical/d")
tg.grepStderr("imports canonical/b", "did not report canonical/b")
tg.grepStderr("imports canonical/a/: non-canonical", "did not report canonical/a/")
}
func TestVersionControlErrorMessageIncludesCorrectDirectory(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()

View File

@ -0,0 +1,21 @@
env GO111MODULE=off
! go build canonical/d
stderr 'package canonical/d'
stderr 'imports canonical/b'
stderr 'imports canonical/a/: non-canonical'
-- canonical/a/a.go --
package a
import _ "c"
-- canonical/b/b.go --
package b
import _ "canonical/a/"
-- canonical/a/vendor/c/c.go --
package c
-- canonical/d/d.go --
package d
import _ "canonical/b"

View File

@ -1,3 +0,0 @@
package a
import _ "c"

View File

@ -1 +0,0 @@
package c

View File

@ -1,3 +0,0 @@
package b
import _ "canonical/a/"

View File

@ -1,3 +0,0 @@
package d
import _ "canonical/b"