TestDialectAllDialectsCoverage ensures all returned dialects from AllDialects() can be used to create Keywords instances.
(t *testing.T)
| 636 | // TestDialectAllDialectsCoverage ensures all returned dialects from AllDialects() |
| 637 | // can be used to create Keywords instances. |
| 638 | func 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 | } |
nothing calls this directly
no test coverage detected