Skip to content

Commit

Permalink
unify short name for mysqlConn in connection_test
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Apr 30, 2024
1 parent 8d421d9 commit 2e81828
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func TestInterpolateParamsUint64(t *testing.T) {

func TestCheckNamedValue(t *testing.T) {
value := driver.NamedValue{Value: ^uint64(0)}
x := &mysqlConn{}
err := x.CheckNamedValue(&value)
mc := &mysqlConn{}
err := mc.CheckNamedValue(&value)

if err != nil {
t.Fatal("uint64 high-bit not convertible", err)
Expand Down Expand Up @@ -159,13 +159,13 @@ func TestCleanCancel(t *testing.T) {

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

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

if err != driver.ErrBadConn {
t.Errorf("expected driver.ErrBadConn, got %#v", err)
Expand All @@ -174,15 +174,15 @@ func TestPingMarkBadConnection(t *testing.T) {

func TestPingErrInvalidConn(t *testing.T) {
nc := badConnection{err: errors.New("failed to write"), n: 10}
ms := &mysqlConn{
mc := &mysqlConn{
netConn: nc,
buf: newBuffer(nc),
maxAllowedPacket: defaultMaxAllowedPacket,
closech: make(chan struct{}),
cfg: NewConfig(),
}

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

if err != ErrInvalidConn {
t.Errorf("expected ErrInvalidConn, got %#v", err)
Expand Down

0 comments on commit 2e81828

Please sign in to comment.