Skip to content

Commit

Permalink
Create a single test parser
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Apr 9, 2024
1 parent 5623fe2 commit 306d6ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/vtctl/workflow/materializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ func TestStripConstraints(t *testing.T) {
}

func TestStripAutoIncrement(t *testing.T) {
parser := sqlparser.NewTestParser()

tcs := []struct {
desc string
ddl string
Expand Down Expand Up @@ -275,7 +277,7 @@ func TestStripAutoIncrement(t *testing.T) {
}

for _, tc := range tcs {
strippedDDL, err := stripAutoIncrement(tc.ddl, sqlparser.NewTestParser())
strippedDDL, err := stripAutoIncrement(tc.ddl, parser)
require.Equal(t, tc.expectErr, (err != nil), "unexpected error result", "expected error %t, got: %v", tc.expectErr, err)
require.Equal(t, tc.want, strippedDDL, fmt.Sprintf("stripped DDL %q does not match our expected result: %q", strippedDDL, tc.want))
}
Expand Down

0 comments on commit 306d6ee

Please sign in to comment.