From 028f718beda6237457210ecb519067bd0cd08670 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 16 Jun 2024 13:25:26 +0900 Subject: [PATCH] fix tests --- connection_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/connection_test.go b/connection_test.go index c59cb6176..6f8d2a6d7 100644 --- a/connection_test.go +++ b/connection_test.go @@ -163,6 +163,8 @@ func TestPingMarkBadConnection(t *testing.T) { netConn: nc, buf: newBuffer(nc), maxAllowedPacket: defaultMaxAllowedPacket, + closech: make(chan struct{}), + cfg: NewConfig(), } err := mc.Ping(context.Background()) @@ -184,8 +186,8 @@ func TestPingErrInvalidConn(t *testing.T) { err := mc.Ping(context.Background()) - if err != ErrInvalidConn { - t.Errorf("expected ErrInvalidConn, got %#v", err) + if err != nc.err { + t.Errorf("expected %#v, got %#v", nc.err, err) } }