Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/go/loader: tests fail with go 1.5 tip #11902

Closed
mwhudson opened this issue Jul 28, 2015 · 6 comments
Closed

x/tools/go/loader: tests fail with go 1.5 tip #11902

mwhudson opened this issue Jul 28, 2015 · 6 comments
Milestone

Comments

@mwhudson
Copy link
Contributor

mwhudson@glamdring:tools$ go test ./go/loader
cannot find package "nosuchpkg" in any of:
    /opt/opensource/go/src/nosuchpkg (from $GOROOT)
    /opt/opensource/gopath/src/nosuchpkg (from $GOPATH)
cannot find package "nosuchpkg" in any of:
    /opt/opensource/go/src/nosuchpkg (from $GOROOT)
    /opt/opensource/gopath/src/nosuchpkg (from $GOPATH)
open missing.go: no such file or directory
open missing.go: no such file or directory
testdata/badpkgdecl.go:1:34: expected 'package', found 'EOF'
testdata/badpkgdecl.go:1:34: expected 'package', found 'EOF'
/go/src/b/x.go:1:21: could not import c (cannot find package "c" in any of:
    /go/src/c (from $GOROOT)
    ($GOPATH not set))
/go/src/b/x.go:1:21: could not import c (cannot find package "c" in any of:
    /go/src/c (from $GOROOT)
    ($GOPATH not set))
/go/src/b/x.go:1:21: could not import c (/go/src/c/x.go:1:8: expected 'IDENT', found 'EOF')
/go/src/c/x.go:1:20: expected operand, found 'EOF'
cannot find package "two/three" in any of:
    /go/src/two/three (from $GOROOT)
    ($GOPATH not set)
/go/src/c/x.go:1:31: cannot convert false (untyped bool constant) to int
--- FAIL: ExampleConfig_CreateFromFiles (0.52s)
got:
created: [hello]
imported: []
initial: [hello]
all: [errors fmt hello io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8]
strconv.Files: [atob.go atof.go atoi.go decimal.go doc.go extfloat.go ftoa.go isprint.go itoa.go quote.go]
want:
created: [hello]
imported: []
initial: [hello]
all: [errors fmt hello io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8]
strconv.Files: [atob.go atof.go atoi.go decimal.go extfloat.go ftoa.go isprint.go itoa.go quote.go]
--- FAIL: ExampleConfig_Import (0.47s)
got:
created: [strconv_test]
imported: [errors strconv unicode/utf8]
initial: [errors strconv strconv_test unicode/utf8]
all: [bufio bytes errors flag fmt io log math math/rand os reflect runtime runtime/pprof runtime/trace sort strconv strconv_test strings sync sync/atomic syscall testing text/tabwriter time unicode unicode/utf8]
strconv.Files: [atob.go atof.go atoi.go decimal.go doc.go extfloat.go ftoa.go isprint.go itoa.go quote.go internal_test.go]
strconv_test.Files: [atob_test.go atof_test.go atoi_test.go decimal_test.go example_test.go fp_test.go ftoa_test.go itoa_test.go quote_test.go strconv_test.go]
want:
created: [strconv_test]
imported: [errors strconv unicode/utf8]
initial: [errors strconv strconv_test unicode/utf8]
all: [bufio bytes errors flag fmt io math math/rand os reflect runtime runtime/pprof sort strconv strconv_test strings sync sync/atomic syscall testing text/tabwriter time unicode unicode/utf8]
strconv.Files: [atob.go atof.go atoi.go decimal.go extfloat.go ftoa.go isprint.go itoa.go quote.go internal_test.go]
strconv_test.Files: [atob_test.go atof_test.go atoi_test.go decimal_test.go fp_test.go ftoa_test.go itoa_test.go quote_example_test.go quote_test.go strconv_test.go]
FAIL
FAIL    golang.org/x/tools/go/loader    8.705s
mwhudson@glamdring:tools$ 
@mwhudson
Copy link
Contributor Author

Don't know if this is related to #11861 at all.

@mwhudson
Copy link
Contributor Author

I don't think it is related to that bug, this diff fixes it:

diff --git a/go/loader/example_test.go b/go/loader/example_test.go
index 9fb5fdc..141a7e2 100644
--- a/go/loader/example_test.go
+++ b/go/loader/example_test.go
@@ -137,7 +137,7 @@ func ExampleConfig_CreateFromFiles() {
        // imported: []
        // initial: [hello]
        // all: [errors fmt hello io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8]
-       // strconv.Files: [atob.go atof.go atoi.go decimal.go extfloat.go ftoa.go isprint.go itoa.go quote.go]
+       // strconv.Files: [atob.go atof.go atoi.go decimal.go doc.go extfloat.go ftoa.go isprint.go itoa.go quote.go]
 }

 // This example imports three packages, including the tests for one of
@@ -164,7 +164,7 @@ func ExampleConfig_Import() {
        // created: [strconv_test]
        // imported: [errors strconv unicode/utf8]
        // initial: [errors strconv strconv_test unicode/utf8]
-       // all: [bufio bytes errors flag fmt io math math/rand os reflect runtime runtime/pprof sort strconv strconv_test strings sync sync/atomic syscall testing text/tabwriter time unicode unicode/utf8]
-       // strconv.Files: [atob.go atof.go atoi.go decimal.go extfloat.go ftoa.go isprint.go itoa.go quote.go internal_test.go]
-       // strconv_test.Files: [atob_test.go atof_test.go atoi_test.go decimal_test.go fp_test.go ftoa_test.go itoa_test.go quote_example_test.go quote_test.go strconv_test.go]
+       // all: [bufio bytes errors flag fmt io log math math/rand os reflect runtime runtime/pprof runtime/trace sort strconv strconv_test strings sync sync/atomic syscall testing text/tabwriter time unicode unicode/utf8]
+       // strconv.Files: [atob.go atof.go atoi.go decimal.go doc.go extfloat.go ftoa.go isprint.go itoa.go quote.go internal_test.go]
+       // strconv_test.Files: [atob_test.go atof_test.go atoi_test.go decimal_test.go example_test.go fp_test.go ftoa_test.go itoa_test.go quote_test.go strconv_test.go]
 }

but of course makes it fail with Go 1.4.

@bradfitz bradfitz changed the title x/tools/cmd/go/loader: tests fail with go 1.5 tip x/tools/go/loader: tests fail with go 1.5 tip Jul 29, 2015
@bradfitz bradfitz added this to the Go1.5 milestone Jul 29, 2015
@bradfitz
Copy link
Contributor

(Part of #11811)

@bradfitz
Copy link
Contributor

/cc @alandonovan

@alexbrainman
Copy link
Member

@alandonovan
Copy link
Contributor

Thanks alexbrainman.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants