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

Function TestDialectAllDialectsCoverage

pkg/sql/keywords/snowflake_test.go:638–659  ·  view source on GitHub ↗

TestDialectAllDialectsCoverage ensures all returned dialects from AllDialects() can be used to create Keywords instances.

(t *testing.T)

Source from the content-addressed store, hash-verified

636// TestDialectAllDialectsCoverage ensures all returned dialects from AllDialects()
637// can be used to create Keywords instances.
638func TestDialectAllDialectsCoverage(t *testing.T) {
639 dialects := AllDialects()
640 for _, dialect := range dialects {
641 t.Run(string(dialect), func(t *testing.T) {
642 k := New(dialect, true)
643 if k == nil {
644 t.Errorf("New(%q, true) returned nil", dialect)
645 return
646 }
647 // All dialects should have core SQL keywords
648 if !k.IsKeyword("SELECT") {
649 t.Errorf("Dialect %q should have SELECT keyword", dialect)
650 }
651 if !k.IsKeyword("FROM") {
652 t.Errorf("Dialect %q should have FROM keyword", dialect)
653 }
654 if !k.IsKeyword("WHERE") {
655 t.Errorf("Dialect %q should have WHERE keyword", dialect)
656 }
657 })
658 }
659}

Callers

nothing calls this directly

Calls 5

AllDialectsFunction · 0.85
RunMethod · 0.80
NewFunction · 0.70
ErrorfMethod · 0.65
IsKeywordMethod · 0.45

Tested by

no test coverage detected