diff --git a/cmd/guru/guru_test.go b/cmd/guru/guru_test.go index 9652bd9d64..34322552f6 100644 --- a/cmd/guru/guru_test.go +++ b/cmd/guru/guru_test.go @@ -225,7 +225,7 @@ func TestGuru(t *testing.T) { "testdata/src/freevars/main.go", "testdata/src/implements/main.go", "testdata/src/implements-methods/main.go", - // "testdata/src/imports/main.go", // disabled until golang.org/issue/19464 is fixed + "testdata/src/imports/main.go", "testdata/src/peers/main.go", "testdata/src/pointsto/main.go", "testdata/src/referrers/main.go", diff --git a/cmd/guru/testdata/src/imports/main.go b/cmd/guru/testdata/src/imports/main.go index 3bab36a915..9fe2b711f8 100644 --- a/cmd/guru/testdata/src/imports/main.go +++ b/cmd/guru/testdata/src/imports/main.go @@ -1,8 +1,8 @@ package main import ( - "hash/fnv" // @describe ref-pkg-import2 "fnv" - "lib" // @describe ref-pkg-import "lib" + "lib" // @describe ref-pkg-import "lib" + "lib/sublib" // @describe ref-pkg-import2 "sublib" ) // Tests that import another package. (To make the tests run quickly, @@ -25,5 +25,5 @@ func main() { var _ lib.Type // @describe ref-pkg "lib" - fnv.New32() + _ = sublib.C } diff --git a/cmd/guru/testdata/src/imports/main.golden b/cmd/guru/testdata/src/imports/main.golden index 89cfb2b602..1e1221789e 100644 --- a/cmd/guru/testdata/src/imports/main.golden +++ b/cmd/guru/testdata/src/imports/main.golden @@ -1,10 +1,3 @@ --------- @describe ref-pkg-import2 -------- -import of package "hash/fnv" - func New32 func() hash.Hash32 - func New32a func() hash.Hash32 - func New64 func() hash.Hash64 - func New64a func() hash.Hash64 - -------- @describe ref-pkg-import -------- import of package "lib" const Const untyped int = 3 @@ -18,6 +11,10 @@ import of package "lib" method (Type) Method(x *int) *int var Var int +-------- @describe ref-pkg-import2 -------- +import of package "lib/sublib" + const C untyped int = 0 + -------- @describe ref-const -------- reference to const lib.Const untyped int of value 3 defined here diff --git a/cmd/guru/testdata/src/lib/sublib/sublib.go b/cmd/guru/testdata/src/lib/sublib/sublib.go new file mode 100644 index 0000000000..33c6498a34 --- /dev/null +++ b/cmd/guru/testdata/src/lib/sublib/sublib.go @@ -0,0 +1,3 @@ +package sublib + +const C = 0