Commit 22b4c835 authored by Robert Griesemer's avatar Robert Griesemer

go/types: don't use directory foo which might exist under GOPATH

Simply choose an extremely unlikely path name in the test is fine.

Fixes #21013.

Change-Id: I56c0a1986b5ef5d618c7fe2b14701f584fe81c37
Reviewed-on: https://go-review.googlesource.com/81578
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent ce5292a1
......@@ -1373,7 +1373,7 @@ func TestFailedImport(t *testing.T) {
const src = `
package p
import "foo" // should only see an error here
import foo "go/types/thisdirectorymustnotexistotherwisethistestmayfail/foo" // should only see an error here
const c = foo.C
type T = foo.T
......@@ -1393,7 +1393,7 @@ func f(x T) T { return foo.F(x) }
conf := Config{
Error: func(err error) {
// we should only see the import error
if errcount > 0 || !strings.Contains(err.Error(), "could not import foo") {
if errcount > 0 || !strings.Contains(err.Error(), "could not import") {
t.Errorf("for %s importer, got unexpected error: %v", compiler, err)
}
errcount++
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment