TestSnowflakeDialectKeywords verifies DialectKeywords returns the Snowflake keyword list.
(t *testing.T)
| 194 | |
| 195 | // TestSnowflakeDialectKeywords verifies DialectKeywords returns the Snowflake keyword list. |
| 196 | func 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 |
nothing calls this directly
no test coverage detected