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

Function TestRenderSelect_Distinct

pkg/formatter/render_test.go:111–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestRenderSelect_Distinct(t *testing.T) {
112 stmt := &ast.SelectStatement{
113 Distinct: true,
114 Columns: []ast.Expression{&ast.Identifier{Name: "a"}},
115 From: []ast.TableReference{{Name: "t"}},
116 }
117 result := fmtStmt(stmt, ast.CompactStyle())
118 if !strings.Contains(result, "DISTINCT") {
119 t.Errorf("expected DISTINCT, got: %s", result)
120 }
121}
122
123func TestRenderSelect_AllClauses(t *testing.T) {
124 lim := 10

Callers

nothing calls this directly

Calls 3

CompactStyleFunction · 0.92
fmtStmtFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected