Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner/core: migrate test-infra to testify for expression_rewriter_test.go #32510

Merged
merged 3 commits into from
Feb 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup deps to util/testutil
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Feb 21, 2022
commit c51a6c7ab3ddd8e098f276b95586b488132c2712
5 changes: 2 additions & 3 deletions planner/core/expression_rewriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
plannercore "github.com/pingcap/tidb/planner/core"
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/testkit/testdata"
"github.com/pingcap/tidb/util/testutil"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -88,7 +87,7 @@ func TestDefaultFunction(t *testing.T) {
default(d) as defd,
default(e) as defe,
default(f) as deff
from t1`).Check(testutil.RowsWithSep("|", "def|<nil>|10|3.14|2018-01-01 00:00:00|2011-11-11 11:11:11"))
from t1`).Check(testkit.RowsWithSep("|", "def|<nil>|10|3.14|2018-01-01 00:00:00|2011-11-11 11:11:11"))
require.EqualError(t, tk.ExecToErr("select default(x) from t1"), "[planner:1054]Unknown column 'x' in 'field list'")

tk.MustQuery("select default(a0) from (select a as a0 from t1) as t0").Check(testkit.Rows("def"))
Expand All @@ -111,7 +110,7 @@ func TestDefaultFunction(t *testing.T) {
default(b) as defb,
default(c) as defc,
default(d) as defd
from t3`).Check(testutil.RowsWithSep("|", "2011-11-11 11:11:11|2011-11-11 11:11:11|2011-11-11 11:11:11.000000|current_timestamp"))
from t3`).Check(testkit.RowsWithSep("|", "2011-11-11 11:11:11|2011-11-11 11:11:11|2011-11-11 11:11:11.000000|current_timestamp"))

tk.MustExec(`create table t4(a int default 1, b varchar(5))`)
tk.MustExec(`insert into t4 values (0, 'B'), (1, 'B'), (2, 'B')`)
Expand Down