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

Function TestIsValidDialect

pkg/sql/parser/dialect_test.go:170–186  ·  view source on GitHub ↗

TestIsValidDialect covers the IsValidDialect helper.

(t *testing.T)

Source from the content-addressed store, hash-verified

168
169// TestIsValidDialect covers the IsValidDialect helper.
170func TestIsValidDialect(t *testing.T) {
171 validDialects := []string{
172 "postgresql", "mysql", "sqlserver", "oracle", "sqlite",
173 "snowflake", "bigquery", "redshift", "generic", "mariadb", "",
174 }
175 for _, d := range validDialects {
176 if !keywords.IsValidDialect(d) {
177 t.Errorf("IsValidDialect(%q) should return true", d)
178 }
179 }
180 invalidDialects := []string{"fakesql", "postgres", "mssql", "pg", "db2"}
181 for _, d := range invalidDialects {
182 if keywords.IsValidDialect(d) {
183 t.Errorf("IsValidDialect(%q) should return false", d)
184 }
185 }
186}
187
188// ---------------------------------------------------------------------------
189// LIMIT dialect gate

Callers

nothing calls this directly

Calls 2

IsValidDialectFunction · 0.92
ErrorfMethod · 0.65

Tested by

no test coverage detected