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

Function TestFormatSQLWithDialect_EmptyDialect

pkg/transform/dialect_test.go:68–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestFormatSQLWithDialect_EmptyDialect(t *testing.T) {
69 tree, err := ParseSQL("SELECT * FROM users")
70 if err != nil {
71 t.Fatalf("parse: %v", err)
72 }
73 stmt := tree.Statements[0]
74 if err := Apply(stmt, SetLimit(10)); err != nil {
75 t.Fatalf("apply: %v", err)
76 }
77
78 // Empty dialect = generic = LIMIT
79 got := FormatSQLWithDialect(stmt, "")
80 if !strings.Contains(got, "LIMIT 10") {
81 t.Errorf("generic: expected LIMIT 10, got: %s", got)
82 }
83}
84
85func TestFormatSQLWithDialect_Pagination(t *testing.T) {
86 tests := []struct {

Callers

nothing calls this directly

Calls 6

ParseSQLFunction · 0.85
ApplyFunction · 0.85
SetLimitFunction · 0.85
FormatSQLWithDialectFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected