From d7b335b87c54fa8a9622ee072f6298f0642eed67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20P=C3=A9rez-Aradros=20Herce?= Date: Mon, 18 Mar 2024 22:20:55 +0100 Subject: [PATCH] fix tests --- pgtype/macaddr_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pgtype/macaddr_test.go b/pgtype/macaddr_test.go index 03dd1db52..11013c699 100644 --- a/pgtype/macaddr_test.go +++ b/pgtype/macaddr_test.go @@ -46,6 +46,20 @@ func TestMacaddrCodec(t *testing.T) { new(string), isExpectedEq("01:23:45:67:89:ab"), }, + {nil, new(*net.HardwareAddr), isExpectedEq((*net.HardwareAddr)(nil))}, + }) + + pgxtest.RunValueRoundTripTests(context.Background(), t, defaultConnTestRunner, pgxtest.KnownOIDQueryExecModes, "macaddr", []pgxtest.ValueRoundTripTest{ + { + mustParseMacaddr(t, "01:23:45:67:89:ab:01:08"), + new(net.HardwareAddr), + isExpectedEqHardwareAddr(mustParseMacaddr(t, "01:23:45:67:89:ab:01:08")), + }, + { + "01:23:45:67:89:ab:01:08", + new(net.HardwareAddr), + isExpectedEqHardwareAddr(mustParseMacaddr(t, "01:23:45:67:89:ab:01:08")), + }, { mustParseMacaddr(t, "01:23:45:67:89:ab:01:08"), new(string),