MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestSnowflakeIncludesBaseKeywords

Function TestSnowflakeIncludesBaseKeywords

pkg/sql/keywords/snowflake_test.go:140–157  ·  view source on GitHub ↗

TestSnowflakeIncludesBaseKeywords verifies that the Snowflake dialect includes all standard base keywords in addition to Snowflake-specific ones.

(t *testing.T)

Source from the content-addressed store, hash-verified

138// TestSnowflakeIncludesBaseKeywords verifies that the Snowflake dialect includes
139// all standard base keywords in addition to Snowflake-specific ones.
140func 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

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
ErrorfMethod · 0.65
IsKeywordMethod · 0.45

Tested by

no test coverage detected