diff --git a/go/loader/loader_test.go b/go/loader/loader_test.go index 0b42e398d55..eb06f04d6c2 100644 --- a/go/loader/loader_test.go +++ b/go/loader/loader_test.go @@ -7,6 +7,7 @@ package loader_test import ( "fmt" "go/build" + "path/filepath" "reflect" "sort" "strings" @@ -221,8 +222,9 @@ func TestLoad_ParseError_AllowErrors(t *testing.T) { if len(badpkg.Files) != 1 { t.Errorf("badpkg has %d files, want 1", len(badpkg.Files)) } - wantErr := "testdata/badpkgdecl.go:1:34: expected 'package', found 'EOF'" + wantErr := filepath.Join("testdata", "badpkgdecl.go") + ":1:34: expected 'package', found 'EOF'" if !hasError(badpkg.Errors, wantErr) { + t.Errorf("badpkg.Errors = %v, want %s", badpkg.Errors, wantErr) } }