]> Cypherpunks repositories - gostls13.git/commit
go/build: update TestImportDirNotExist to accept more detailed error strings
authorBryan C. Mills <bcmills@google.com>
Wed, 29 Jan 2020 14:14:50 +0000 (09:14 -0500)
committerBryan C. Mills <bcmills@google.com>
Wed, 29 Jan 2020 19:54:12 +0000 (19:54 +0000)
commit67fee6005d48f8e4554c3e933763aec7cd503f8f
tree490c8677e15fec37ca450415df4184da12aed390
parenta50c3ffbd47e3dcfc1b5bd2a2d19d55731481eaa
go/build: update TestImportDirNotExist to accept more detailed error strings

In CL 203820, we switched go/build to use the caller's working
directory for the main module (rather than srcDir), so that go/build
resolution now respects the requirements and replacements of the main
module. When the passed-in srcDir is empty, as of that CL we use "go
list" instead of falling back to in-process (GOPATH-mode) path lookup.

Unfortunately, that broke go/build.TestImportDirNotExist when
GO111MODULE=on: the test was looking for the specific error message
produced by the in-process lookup.

This change relaxes the test to accept the error message produced by
"go list" when srcDir is empty.

Updates #34769
Updates #34860
Updates #35734
Fixes #36867

Change-Id: Id0f7814a4b7dabe8917216eb013bb4eaee283648
Reviewed-on: https://go-review.googlesource.com/c/go/+/216817
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/go/build/build_test.go