Skip to content

Commit

Permalink
combine into a single test
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
  • Loading branch information
YangKeao committed Apr 24, 2024
1 parent a8019fb commit db2abf1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pkg/server/internal/testserverclient/server_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2728,7 +2728,7 @@ func (cli *TestServerClient) RunTestConnectionCount(t *testing.T) {
})
}

func (cli *TestServerClient) RunTestTypeOfSendLongData(t *testing.T) {
func (cli *TestServerClient) RunTestTypeAndCharsetOfSendLongData(t *testing.T) {
cli.RunTests(t, func(config *mysql.Config) {
config.MaxAllowedPacket = 1024
}, func(dbt *testkit.DBTestKit) {
Expand All @@ -2753,9 +2753,7 @@ func (cli *TestServerClient) RunTestTypeOfSendLongData(t *testing.T) {
require.Equal(t, str, j)
}
})
}

func (cli *TestServerClient) RunTestCharsetOfSendLongData(t *testing.T) {
str := strings.Repeat("你好", 1024)
enc := simplifiedchinese.GBK.NewEncoder()
gbkStr, err := enc.String(str)
Expand All @@ -2769,6 +2767,8 @@ func (cli *TestServerClient) RunTestCharsetOfSendLongData(t *testing.T) {

conn, err := dbt.GetDB().Conn(ctx)
require.NoError(t, err)
_, err = conn.ExecContext(ctx, "drop table t")
require.NoError(t, err)
_, err = conn.ExecContext(ctx, "CREATE TABLE t (t TEXT);")
require.NoError(t, err)

Expand Down
9 changes: 2 additions & 7 deletions pkg/server/tests/commontest/tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3083,12 +3083,7 @@ func TestConnectionCount(t *testing.T) {
ts.RunTestConnectionCount(t)
}

func TestTypeOfSendLongData(t *testing.T) {
func TestTypeAndCharsetOfSendLongData(t *testing.T) {
ts := servertestkit.CreateTidbTestSuite(t)
ts.RunTestTypeOfSendLongData(t)
}

func TestCharsetOfSendLongData(t *testing.T) {
ts := servertestkit.CreateTidbTestSuite(t)
ts.RunTestCharsetOfSendLongData(t)
ts.RunTestTypeAndCharsetOfSendLongData(t)
}

0 comments on commit db2abf1

Please sign in to comment.