TestSnowflakeIncludesBaseKeywords verifies that the Snowflake dialect includes all standard base keywords in addition to Snowflake-specific ones.
(t *testing.T)
| 138 | // TestSnowflakeIncludesBaseKeywords verifies that the Snowflake dialect includes |
| 139 | // all standard base keywords in addition to Snowflake-specific ones. |
| 140 | func TestSnowflakeIncludesBaseKeywords(t *testing.T) { |
| 141 | k := New(DialectSnowflake, true) |
| 142 | |
| 143 | baseKeywords := []string{ |
| 144 | "SELECT", "FROM", "WHERE", "GROUP", "ORDER", "BY", |
| 145 | "JOIN", "INNER", "LEFT", "RIGHT", "ON", "AS", |
| 146 | "AND", "OR", "NOT", "IN", "LIKE", "BETWEEN", |
| 147 | "HAVING", "LIMIT", "OFFSET", "UNION", |
| 148 | "COUNT", "SUM", "AVG", "MIN", "MAX", |
| 149 | "CASE", "WHEN", "THEN", "ELSE", "END", |
| 150 | } |
| 151 | |
| 152 | for _, word := range baseKeywords { |
| 153 | if !k.IsKeyword(word) { |
| 154 | t.Errorf("Base keyword %q should exist in Snowflake dialect", word) |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | // TestSnowflakeKeywordsBaseOverlap verifies that keywords which exist in both |
| 160 | // the base set and the Snowflake set don't cause issues (the base definition |