Skip to content

Commit a8d0fa5

Browse files
findleyrgopherbot
authored andcommitted
go/packages: call testenv.NeedsGoPackages for TestDirAndForTest
To be consistent with other tests, and fix the breakage on js/wasm, skip TestDirAndForTest on incompatible platforms. Fixes golang/go#70286 Change-Id: I6195005e39103bbff4b5bb9ff99a63247eb0e9c6 Reviewed-on: https://go-review.googlesource.com/c/tools/+/627996 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
1 parent 47a5f7d commit a8d0fa5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

go/packages/packages_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,8 @@ func foo() int {
32123212

32133213
// TestDirAndForTest tests the new fields added as part of golang/go#38445.
32143214
func TestDirAndForTest(t *testing.T) {
3215+
testenv.NeedsGoPackages(t)
3216+
32153217
dir := writeTree(t, `
32163218
-- go.mod --
32173219
module example.com
@@ -3232,15 +3234,13 @@ func Bar() int { return 2 }
32323234
package a_test
32333235
32343236
import (
3235-
"testing"
3236-
32373237
"example.com/a"
32383238
"example.com/b"
32393239
)
32403240
3241-
func TestFooBar(t *testing.T) {
3241+
func _() {
32423242
if got := a.Foo() + a.Bar() + b.Baz(); got != 6 {
3243-
t.Errorf("whoops!")
3243+
panic("whoops")
32443244
}
32453245
}
32463246

0 commit comments

Comments
 (0)