File: 0003-Use-PrivateKey.Equal-to-compare-test-results.patch

package info (click to toggle)
golang-gopkg-hlandau-acmeapi.v2 2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 308 kB
  • sloc: makefile: 4
file content (33 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Shengjing Zhu <zhsj@debian.org>
Date: Fri, 20 Jan 2023 11:55:11 +0800
Subject: Use PrivateKey.Equal to compare test results

Go1.20 adds un-exported field in PrecomputedValues, and initializes
it with non-nil value. So the key can't be compared with
reflect.DeepEqual
---
 acmeutils/load_test.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/acmeutils/load_test.go b/acmeutils/load_test.go
index 2b31526..db3d2df 100644
--- a/acmeutils/load_test.go
+++ b/acmeutils/load_test.go
@@ -400,7 +400,7 @@ func TestLoadKey(t *testing.T) {
 		t.Fatalf("failed to load private key: %v", err)
 	}
 
-	if !reflect.DeepEqual(testKeyValue, pk) {
+	if !testKeyValue.Equal(pk) {
 		t.Fatalf("key mismatch: %#v %#v", testKeyValue, pk)
 	}
 
@@ -409,7 +409,7 @@ func TestLoadKey(t *testing.T) {
 		t.Fatalf("failed to load private key: %v", err)
 	}
 
-	if !reflect.DeepEqual(testKeyValue, pk2) {
+	if !testKeyValue.Equal(pk2) {
 		t.Fatalf("key mismatch: %#v %#v", testKeyValue, pk2)
 	}