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

Function TestRenderDelete_Readable

pkg/formatter/render_test.go:283–296  ·  view source on GitHub ↗

─── DELETE ──────────────────────────────────────────────────────────────────

(t *testing.T)

Source from the content-addressed store, hash-verified

281// ─── DELETE ──────────────────────────────────────────────────────────────────
282
283func TestRenderDelete_Readable(t *testing.T) {
284 stmt := &ast.DeleteStatement{
285 TableName: "users",
286 Where: &ast.BinaryExpression{Left: &ast.Identifier{Name: "id"}, Operator: "=", Right: &ast.LiteralValue{Value: "1"}},
287 }
288
289 result := fmtStmt(stmt, ast.ReadableStyle())
290 if !strings.Contains(result, "DELETE FROM") {
291 t.Errorf("should contain DELETE FROM, got: %s", result)
292 }
293 if !strings.Contains(result, "WHERE") {
294 t.Errorf("should contain WHERE, got: %s", result)
295 }
296}
297
298func TestRenderDelete_AllClauses(t *testing.T) {
299 stmt := &ast.DeleteStatement{

Callers

nothing calls this directly

Calls 3

ReadableStyleFunction · 0.92
fmtStmtFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected