planner: migrate test-infra to testify for planner/core/errors_test (#32055)

close pingcap/tidb#28407
This commit is contained in:
Weizhen Wang
2022-02-01 00:11:31 +08:00
committed by GitHub
parent d177ee4ba6
commit 9f10e692fd

View File

@ -15,16 +15,14 @@
package core
import (
. "github.com/pingcap/check"
"testing"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/terror"
"github.com/stretchr/testify/require"
)
type testErrorSuite struct{}
var _ = Suite(testErrorSuite{})
func (s testErrorSuite) TestError(c *C) {
func TestError(t *testing.T) {
kvErrs := []*terror.Error{
ErrUnsupportedType,
ErrAnalyzeMissIndex,
@ -87,6 +85,6 @@ func (s testErrorSuite) TestError(c *C) {
}
for _, err := range kvErrs {
code := terror.ToSQLError(err).Code
c.Assert(code != mysql.ErrUnknown && code == uint16(err.Code()), IsTrue, Commentf("err: %v", err))
require.Truef(t, code != mysql.ErrUnknown && code == uint16(err.Code()), "err: %v", err)
}
}