Skip to content

Commit

Permalink
cmd/bundle: expand test coverage to all modes
Browse files Browse the repository at this point in the history
As of CL 189818, bundle has been updated to use the go/packages API to
load packages. That API supports module mode and legacy GOPATH mode.
Update the test to provide coverage for all modes.

Updates golang/go#24661.

Change-Id: Ied6196f7317b9b0289faf80dbfe9815e9b98b55d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/255053
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
  • Loading branch information
dmitshur committed Sep 29, 2020
1 parent 5272f30 commit fc8742f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/bundle/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
"golang.org/x/tools/go/packages/packagestest"
)

func TestBundle(t *testing.T) {
func TestBundle(t *testing.T) { packagestest.TestAll(t, testBundle) }
func testBundle(t *testing.T, x packagestest.Exporter) {
load := func(name string) string {
data, err := ioutil.ReadFile(name)
if err != nil {
Expand All @@ -24,7 +25,7 @@ func TestBundle(t *testing.T) {
return string(data)
}

e := packagestest.Export(t, packagestest.Modules, []packagestest.Module{
e := packagestest.Export(t, x, []packagestest.Module{
{
Name: "initial",
Files: map[string]interface{}{
Expand Down

0 comments on commit fc8742f

Please sign in to comment.