Skip to content

Commit 73d5b38

Browse files
committed
Set EquateComparable for netip.Prefix
Signed-off-by: MrMelon54 <[email protected]>
1 parent 2a1ddbe commit 73d5b38

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

internal/wglinux/parse_linux_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package wglinux
55

66
import (
7+
"github.com/google/go-cmp/cmp/cmpopts"
78
"net"
89
"net/netip"
910
"runtime"
@@ -485,7 +486,7 @@ func TestLinuxClientDevicesOK(t *testing.T) {
485486
t.Fatalf("failed to get devices: %v", err)
486487
}
487488

488-
if diff := cmp.Diff(tt.devices, devices); diff != "" {
489+
if diff := cmp.Diff(tt.devices, devices, cmpopts.EquateComparable(netip.Prefix{})); diff != "" {
489490
t.Fatalf("unexpected devices (-want +got):\n%s", diff)
490491
}
491492
})

internal/wguser/parse_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package wguser
22

33
import (
4+
"github.com/google/go-cmp/cmp/cmpopts"
45
"net"
56
"net/netip"
67
"testing"
@@ -157,7 +158,7 @@ func TestClientDevices(t *testing.T) {
157158
return
158159
}
159160

160-
if diff := cmp.Diff([]*wgtypes.Device{tt.d}, devs); diff != "" {
161+
if diff := cmp.Diff([]*wgtypes.Device{tt.d}, devs, cmpopts.EquateComparable(netip.Prefix{})); diff != "" {
161162
t.Fatalf("unexpected Devices (-want +got):\n%s", diff)
162163
}
163164
})

0 commit comments

Comments
 (0)