From: Robert Griesemer Date: Fri, 1 Dec 2017 21:24:20 +0000 (-0800) Subject: go/types: don't use directory foo which might exist under GOPATH X-Git-Tag: go1.10beta1~50 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=22b4c8358590bff54cdbc4ad2b359913d48ff474;p=gostls13.git 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 Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/go/types/api_test.go b/src/go/types/api_test.go index 57daf0efb8..1d3c32520a 100644 --- a/src/go/types/api_test.go +++ b/src/go/types/api_test.go @@ -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++