Skip to content

Commit

Permalink
go/packages: drop pruned packages in tests of import graph
Browse files Browse the repository at this point in the history
Explicitly listing the pruned packages ties the test to the details of
how the testing package is implemented. That shouldn't matter, and it
changes in CL 219639. This change makes it possible to work whether or
not CL 219639 is committed.

Updates golang/go#34129

Change-Id: I45875dadeaac42a1002e1329a1a762e340c5352c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/221657
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Changkun Ou <euryugasaki@gmail.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
  • Loading branch information
ianlancetaylor committed Mar 10, 2020
1 parent 0983143 commit 71bfc1b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions go/packages/packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ func testLoadImportsGraph(t *testing.T, exporter packagestest.Exporter) {
golang.org/fake/subdir/d [golang.org/fake/subdir/d.test] -> math/bits
golang.org/fake/subdir/d.test -> golang.org/fake/subdir/d [golang.org/fake/subdir/d.test]
golang.org/fake/subdir/d.test -> golang.org/fake/subdir/d_test [golang.org/fake/subdir/d.test]
golang.org/fake/subdir/d.test -> os (pruned)
golang.org/fake/subdir/d.test -> testing (pruned)
golang.org/fake/subdir/d.test -> testing/internal/testdeps (pruned)
golang.org/fake/subdir/d_test [golang.org/fake/subdir/d.test] -> golang.org/fake/subdir/d [golang.org/fake/subdir/d.test]
`[1:]

Expand Down Expand Up @@ -178,9 +175,6 @@ func testLoadImportsGraph(t *testing.T, exporter packagestest.Exporter) {
golang.org/fake/subdir/d [golang.org/fake/subdir/d.test] -> math/bits
golang.org/fake/subdir/d.test -> golang.org/fake/subdir/d [golang.org/fake/subdir/d.test]
golang.org/fake/subdir/d.test -> golang.org/fake/subdir/d_test [golang.org/fake/subdir/d.test]
golang.org/fake/subdir/d.test -> os (pruned)
golang.org/fake/subdir/d.test -> testing (pruned)
golang.org/fake/subdir/d.test -> testing/internal/testdeps (pruned)
golang.org/fake/subdir/d_test [golang.org/fake/subdir/d.test] -> golang.org/fake/subdir/d [golang.org/fake/subdir/d.test]
`[1:]

Expand Down Expand Up @@ -259,9 +253,6 @@ func testLoadImportsGraph(t *testing.T, exporter packagestest.Exporter) {
golang.org/fake/subdir/d [golang.org/fake/subdir/d.test] -> math/bits
golang.org/fake/subdir/d.test -> golang.org/fake/subdir/d [golang.org/fake/subdir/d.test]
golang.org/fake/subdir/d.test -> golang.org/fake/subdir/d_test [golang.org/fake/subdir/d.test]
golang.org/fake/subdir/d.test -> os (pruned)
golang.org/fake/subdir/d.test -> testing (pruned)
golang.org/fake/subdir/d.test -> testing/internal/testdeps (pruned)
golang.org/fake/subdir/d_test [golang.org/fake/subdir/d.test] -> golang.org/fake/subdir/d [golang.org/fake/subdir/d.test]
`[1:]

Expand Down Expand Up @@ -303,9 +294,6 @@ func testLoadImportsTestVariants(t *testing.T, exporter packagestest.Exporter) {
golang.org/fake/a [golang.org/fake/b.test] -> golang.org/fake/b [golang.org/fake/b.test]
golang.org/fake/b.test -> golang.org/fake/b [golang.org/fake/b.test]
golang.org/fake/b.test -> golang.org/fake/b_test [golang.org/fake/b.test]
golang.org/fake/b.test -> os (pruned)
golang.org/fake/b.test -> testing (pruned)
golang.org/fake/b.test -> testing/internal/testdeps (pruned)
golang.org/fake/b_test [golang.org/fake/b.test] -> golang.org/fake/a [golang.org/fake/b.test]
`[1:]

Expand Down Expand Up @@ -2672,7 +2660,6 @@ func importGraph(initial []*packages.Package) (string, map[string]*packages.Pack
if isTestMain {
switch imp.ID {
case "os", "reflect", "testing", "testing/internal/testdeps":
edges = append(edges, fmt.Sprintf("%s -> %s (pruned)", p, imp))
continue
}
}
Expand Down

0 comments on commit 71bfc1b

Please sign in to comment.