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

Function TestRenderIn_Subquery

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

Source from the content-addressed store, hash-verified

962}
963
964func TestRenderIn_Subquery(t *testing.T) {
965 expr := &ast.InExpression{
966 Expr: &ast.Identifier{Name: "id"},
967 Subquery: &ast.SelectStatement{
968 Columns: []ast.Expression{&ast.Identifier{Name: "id"}},
969 From: []ast.TableReference{{Name: "other"}},
970 },
971 }
972 result := fmtExpr(expr, ast.ReadableStyle())
973 if !strings.Contains(result, "IN (") || !strings.Contains(result, "SELECT") {
974 t.Errorf("expected IN (SELECT ...) in: %s", result)
975 }
976}
977
978func TestRenderIn_Nil(t *testing.T) {
979 var expr *ast.InExpression

Callers

nothing calls this directly

Calls 3

ReadableStyleFunction · 0.92
fmtExprFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected