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

Function TestWithClause_SQL

pkg/sql/ast/sql_coverage_test.go:89–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestWithClause_SQL(t *testing.T) {
90 w := &WithClause{
91 Recursive: true,
92 CTEs: []*CommonTableExpr{
93 {
94 Name: "cte1",
95 Columns: []string{"a", "b"},
96 Statement: &SelectStatement{Columns: []Expression{&Identifier{Name: "x"}}, From: []TableReference{{Name: "t"}}},
97 },
98 },
99 }
100 sql := w.SQL()
101 for _, want := range []string{"WITH RECURSIVE", "cte1 (a, b) AS"} {
102 if !strings.Contains(sql, want) {
103 t.Errorf("missing %q in: %s", want, sql)
104 }
105 }
106}
107
108func TestSetOperation_SQL(t *testing.T) {
109 s := &SetOperation{

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected