From 71bfc1b943ce40133882e178c7eea559d5e7c22d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 29 Feb 2020 18:16:24 -0800 Subject: [PATCH] go/packages: drop pruned packages in tests of import graph 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 TryBot-Result: Gobot Gobot Reviewed-by: Changkun Ou Reviewed-by: Michael Matloob --- go/packages/packages_test.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/go/packages/packages_test.go b/go/packages/packages_test.go index 0be6f77dbe..95ce271245 100644 --- a/go/packages/packages_test.go +++ b/go/packages/packages_test.go @@ -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:] @@ -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:] @@ -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:] @@ -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:] @@ -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 } }