Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Nov 6, 2023
1 parent ffab0e2 commit 233f925
Show file tree
Hide file tree
Showing 3 changed files with 6,819 additions and 6,554 deletions.
12 changes: 12 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7632,6 +7632,11 @@ func TestKeywordsCorrectlyParse(t *testing.T) {
"SELECT %s.c FROM t",
"ALTER TABLE t DROP CONSTRAINT %s",
"ALTER TABLE t DROP CHECK %s",
"ALTER TABLE t DROP COLUMN %s",
}

multikeyword_tests := []string{
"ALTER TABLE t RENAME COLUMN %s TO %s",
}

for _, kw := range correctlyDoParse {
Expand All @@ -7642,6 +7647,13 @@ func TestKeywordsCorrectlyParse(t *testing.T) {
assert.NoError(t, err)
})
}
for _, query := range multikeyword_tests {
test := fmt.Sprintf(query, kw, kw)
t.Run(test, func(t *testing.T) {
_, err := Parse(test)
assert.NoError(t, err)
})
}
}
}

Expand Down
Loading

0 comments on commit 233f925

Please sign in to comment.