─── CREATE TABLE ─────────────────────────────────────────────────────────────
(t *testing.T)
| 324 | // ─── CREATE TABLE ───────────────────────────────────────────────────────────── |
| 325 | |
| 326 | func TestRenderCreateTable_Readable(t *testing.T) { |
| 327 | stmt := &ast.CreateTableStatement{ |
| 328 | Name: "users", |
| 329 | Columns: []ast.ColumnDef{ |
| 330 | {Name: "id", Type: "INT"}, |
| 331 | {Name: "name", Type: "TEXT"}, |
| 332 | }, |
| 333 | } |
| 334 | |
| 335 | result := fmtStmt(stmt, ast.ReadableStyle()) |
| 336 | if !strings.Contains(result, "CREATE TABLE") { |
| 337 | t.Errorf("should contain CREATE TABLE, got: %s", result) |
| 338 | } |
| 339 | if !strings.Contains(result, "\n") { |
| 340 | t.Errorf("should have newlines for readable, got: %s", result) |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | func TestRenderCreateTable_AllFeatures(t *testing.T) { |
| 345 | stmt := &ast.CreateTableStatement{ |
nothing calls this directly
no test coverage detected