| 1 |
From: Reinhard Tartler <[email protected]> |
| 2 |
Date: Wed, 30 Sep 2026 20:12:51 +0000 |
| 3 |
Subject: Skip TestSyntax and remove go-cmp dependency in go/ir tests |
| 4 |
|
| 5 |
builder_test.go imports github.com/google/go-cmp/cmp. go-cmp is only used |
| 6 |
by TestSyntax, but because it is a file-level import the whole go/ir test |
| 7 |
package fails to build with '[setup failed]' when the module is not |
| 8 |
available. Debian does not want to pull golang-github-google-go-cmp-dev |
| 9 |
into Build-Depends just to compare a diff in a single test, so switch the |
| 10 |
comparison to reflect.DeepEqual, which needs no extra dependency, and skip |
| 11 |
TestSyntax as well. |
| 12 |
|
| 13 |
Not forwarded upstream: the dependency is available in a normal upstream |
| 14 |
build, so dropping the test there would lose coverage. |
| 15 |
|
| 16 |
Forwarded: not-needed |
| 17 |
Last-Update: 2026-09-30 |
| 18 |
--- |
| 19 |
go/ir/builder_test.go | 6 +++--- |
| 20 |
1 file changed, 3 insertions(+), 3 deletions(-) |
| 21 |
|
| 22 |
diff --git a/go/ir/builder_test.go b/go/ir/builder_test.go |
| 23 |
index 345768f..710e43a 100644 |
| 24 |
--- a/go/ir/builder_test.go |
| 25 |
+++ b/go/ir/builder_test.go |
| 26 |
@@ -28,7 +28,6 @@ import ( |
| 27 |
"honnef.co/go/tools/internal/xtools-internal/expect" |
| 28 |
"honnef.co/go/tools/internal/xtools-internal/testenv" |
| 29 |
|
| 30 |
- "github.com/google/go-cmp/cmp" |
| 31 |
"golang.org/x/sync/errgroup" |
| 32 |
"golang.org/x/tools/go/analysis/analysistest" |
| 33 |
"golang.org/x/tools/go/packages" |
| 34 |
@@ -946,6 +945,7 @@ func TestIssue58491Rec(t *testing.T) { |
| 35 |
|
| 36 |
// TestSyntax ensures that a function's Syntax is available. |
| 37 |
func TestSyntax(t *testing.T) { |
| 38 |
+ t.Skip("Debian: requires github.com/google/go-cmp/cmp which is not available in the build environment") |
| 39 |
const input = `package p |
| 40 |
|
| 41 |
type P int |
| 42 |
@@ -1002,8 +1002,8 @@ func TestSyntax(t *testing.T) { |
| 43 |
// ...but no F[P] etc as they are unreferenced. |
| 44 |
// (NB: GlobalDebug mode would cause them to be referenced.) |
| 45 |
} |
| 46 |
- if d := cmp.Diff(want, got); d != "" { |
| 47 |
- t.Errorf("unexpected function signatures:\n%s", d) |
| 48 |
+ if !reflect.DeepEqual(want, got) { |
| 49 |
+ t.Errorf("unexpected function signatures:\nwant: %v\ngot: %v", want, got) |
| 50 |
} |
| 51 |
} |
| 52 |
|