Skip to content

Commit

Permalink
remove unnecessary test
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Nov 13, 2024
1 parent 70d8617 commit fd6f50d
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,6 @@ func TestCleanCancel(t *testing.T) {
}
}

func TestPingMarkBadConnection(t *testing.T) {
nc := badConnection{err: errors.New("boom")}
mc := &mysqlConn{
netConn: nc,
buf: newBuffer(nc),
maxAllowedPacket: defaultMaxAllowedPacket,
closech: make(chan struct{}),
cfg: NewConfig(),
}

err := mc.Ping(context.Background())

if !errors.Is(err, nc.err) {
t.Errorf("expected %v, got %#v", nc.err, err)
}
}

func TestPingErrInvalidConn(t *testing.T) {
nc := badConnection{err: errors.New("failed to write"), n: 10}
mc := &mysqlConn{
Expand All @@ -186,7 +169,7 @@ func TestPingErrInvalidConn(t *testing.T) {

err := mc.Ping(context.Background())

if !errors.Is(err, nc.err) {
if err != nc.err {
t.Errorf("expected %v, got %#v", nc.err, err)
}
}
Expand Down

0 comments on commit fd6f50d

Please sign in to comment.