Skip to content

Commit

Permalink
test: fix tests that check error
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Dec 13, 2023
1 parent f8dcfa7 commit da6efc9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion go/vt/vtgate/planbuilder/operators/queryprojection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestQP(t *testing.T) {
_, err = semantics.Analyze(sel, "", &semantics.FakeSI{})
require.NoError(t, err)

qp := createQPFromSelect(ctx, sel)
qp, err := getQPAndError(ctx, sel)
if tcase.expErr != "" {
require.Error(t, err)
require.Contains(t, err.Error(), tcase.expErr)
Expand All @@ -103,6 +103,12 @@ func TestQP(t *testing.T) {
}
}

func getQPAndError(ctx *plancontext.PlanningContext, sel *sqlparser.Select) (qp *QueryProjection, err error) {
defer PanicHandler(&err)
qp = createQPFromSelect(ctx, sel)
return
}

func TestQPSimplifiedExpr(t *testing.T) {
testCases := []struct {
query, expected string
Expand Down

0 comments on commit da6efc9

Please sign in to comment.