Skip to content

Commit

Permalink
executor: migrate test-infra to testify for executor/shuffle_test.go (
Browse files Browse the repository at this point in the history
  • Loading branch information
tongtongyin authored Dec 13, 2021
1 parent 6495a5a commit 9a64217
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions executor/shuffle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@
package executor

import (
. "github.com/pingcap/check"
"testing"

"github.com/pingcap/tidb/expression"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/mock"
"github.com/stretchr/testify/require"
)

var _ = SerialSuites(&testPartitionSuite{})

type testPartitionSuite struct {
}
func TestPartitionRangeSplitter(t *testing.T) {
t.Parallel()

func (s *testPartitionSuite) TestPartitionRangeSplitter(c *C) {
ctx := mock.NewContext()
concurrency := 2

Expand Down Expand Up @@ -60,9 +59,9 @@ func (s *testPartitionSuite) TestPartitionRangeSplitter(c *C) {

splitter := buildPartitionRangeSplitter(ctx, concurrency, byItems)
obtained, err := splitter.split(ctx, input, obtained)
c.Assert(err, IsNil)
c.Assert(len(obtained), Equals, len(expected))
require.NoError(t, err)
require.Len(t, obtained, len(expected))
for i := 0; i < len(obtained); i++ {
c.Assert(obtained[i], Equals, expected[i])
require.Equal(t, expected[i], obtained[i])
}
}

0 comments on commit 9a64217

Please sign in to comment.