Skip to content

Commit

Permalink
go/types: don't use directory foo which might exist under GOPATH
Browse files Browse the repository at this point in the history
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: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
griesemer committed Dec 1, 2017
1 parent ce5292a commit 22b4c83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/go/types/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++
Expand Down

0 comments on commit 22b4c83

Please sign in to comment.