Skip to content

Commit fc8742f

Browse files
committed
cmd/bundle: expand test coverage to all modes
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 <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
1 parent 5272f30 commit fc8742f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/bundle/main_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import (
1515
"golang.org/x/tools/go/packages/packagestest"
1616
)
1717

18-
func TestBundle(t *testing.T) {
18+
func TestBundle(t *testing.T) { packagestest.TestAll(t, testBundle) }
19+
func testBundle(t *testing.T, x packagestest.Exporter) {
1920
load := func(name string) string {
2021
data, err := ioutil.ReadFile(name)
2122
if err != nil {
@@ -24,7 +25,7 @@ func TestBundle(t *testing.T) {
2425
return string(data)
2526
}
2627

27-
e := packagestest.Export(t, packagestest.Modules, []packagestest.Module{
28+
e := packagestest.Export(t, x, []packagestest.Module{
2829
{
2930
Name: "initial",
3031
Files: map[string]interface{}{

0 commit comments

Comments
 (0)