─── DELETE ──────────────────────────────────────────────────────────────────
(t *testing.T)
| 281 | // ─── DELETE ────────────────────────────────────────────────────────────────── |
| 282 | |
| 283 | func 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 | |
| 298 | func TestRenderDelete_AllClauses(t *testing.T) { |
| 299 | stmt := &ast.DeleteStatement{ |
nothing calls this directly
no test coverage detected