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

Function TestSnowflakeKeywordsNotInGeneric

pkg/sql/keywords/snowflake_test.go:118–136  ·  view source on GitHub ↗

TestSnowflakeKeywordsNotInGeneric verifies that Snowflake-specific keywords are NOT present when using the generic dialect.

(t *testing.T)

Source from the content-addressed store, hash-verified

116// TestSnowflakeKeywordsNotInGeneric verifies that Snowflake-specific keywords
117// are NOT present when using the generic dialect.
118func TestSnowflakeKeywordsNotInGeneric(t *testing.T) {
119 k := New(DialectGeneric, true)
120
121 snowflakeOnlyKeywords := []string{
122 "VARIANT", "OBJECT", "FLATTEN", "PARSE_JSON", "STRIP_NULL_VALUE",
123 "TYPEOF", "CHANGES", "STREAM", "TASK", "PIPE", "STAGE",
124 "FILE_FORMAT", "WAREHOUSE", "CLONE", "UNDROP", "RECLUSTER",
125 "BEFORE", "AT", "STATEMENT", "COPY", "PUT", "GET", "REMOVE",
126 "OWNERSHIP", "IFF", "IFNULL", "NVL", "NVL2", "ZEROIFNULL",
127 "EQUAL_NULL", "TRY_CAST", "TRY_TO_NUMBER", "TRY_TO_DATE",
128 "RESULT_SCAN", "GENERATOR", "ROWCOUNT", "LAST_QUERY_ID", "SYSTEM",
129 }
130
131 for _, word := range snowflakeOnlyKeywords {
132 if k.IsKeyword(word) {
133 t.Errorf("Snowflake-only keyword %q should NOT exist in generic dialect", word)
134 }
135 }
136}
137
138// TestSnowflakeIncludesBaseKeywords verifies that the Snowflake dialect includes
139// all standard base keywords in addition to Snowflake-specific ones.

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
ErrorfMethod · 0.65
IsKeywordMethod · 0.45

Tested by

no test coverage detected