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:
parent
49ac23a3cf
commit
c32aab31b1
@ -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()
|
||||
|
21
src/cmd/go/testdata/script/noncanonical_import.txt
vendored
Normal file
21
src/cmd/go/testdata/script/noncanonical_import.txt
vendored
Normal 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"
|
3
src/cmd/go/testdata/src/canonical/a/a.go
vendored
3
src/cmd/go/testdata/src/canonical/a/a.go
vendored
@ -1,3 +0,0 @@
|
||||
package a
|
||||
|
||||
import _ "c"
|
@ -1 +0,0 @@
|
||||
package c
|
3
src/cmd/go/testdata/src/canonical/b/b.go
vendored
3
src/cmd/go/testdata/src/canonical/b/b.go
vendored
@ -1,3 +0,0 @@
|
||||
package b
|
||||
|
||||
import _ "canonical/a/"
|
3
src/cmd/go/testdata/src/canonical/d/d.go
vendored
3
src/cmd/go/testdata/src/canonical/d/d.go
vendored
@ -1,3 +0,0 @@
|
||||
package d
|
||||
|
||||
import _ "canonical/b"
|
Loading…
Reference in New Issue
Block a user