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

Function TestSnowflakeDialectKeywords

pkg/sql/keywords/snowflake_test.go:196–224  ·  view source on GitHub ↗

TestSnowflakeDialectKeywords verifies DialectKeywords returns the Snowflake keyword list.

(t *testing.T)

Source from the content-addressed store, hash-verified

194
195// TestSnowflakeDialectKeywords verifies DialectKeywords returns the Snowflake keyword list.
196func TestSnowflakeDialectKeywords(t *testing.T) {
197 kws := DialectKeywords(DialectSnowflake)
198 if kws == nil {
199 t.Fatal("DialectKeywords(DialectSnowflake) returned nil")
200 }
201
202 if len(kws) != len(SNOWFLAKE_SPECIFIC) {
203 t.Errorf("DialectKeywords(DialectSnowflake) returned %d keywords, want %d",
204 len(kws), len(SNOWFLAKE_SPECIFIC))
205 }
206
207 // Verify the returned slice contains expected keywords
208 foundVariant := false
209 foundWarehouse := false
210 for _, kw := range kws {
211 if kw.Word == "VARIANT" {
212 foundVariant = true
213 }
214 if kw.Word == "WAREHOUSE" {
215 foundWarehouse = true
216 }
217 }
218 if !foundVariant {
219 t.Error("DialectKeywords should contain VARIANT")
220 }
221 if !foundWarehouse {
222 t.Error("DialectKeywords should contain WAREHOUSE")
223 }
224}
225
226// TestSnowflakeKeywordsNoDuplicateBaseKeywords ensures that the SNOWFLAKE_SPECIFIC
227// slice does not contain keywords that already exist in the base keyword sets

Callers

nothing calls this directly

Calls 3

DialectKeywordsFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected