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

Function TestRenderCreateTable_Readable

pkg/formatter/render_test.go:326–342  ·  view source on GitHub ↗

─── CREATE TABLE ─────────────────────────────────────────────────────────────

(t *testing.T)

Source from the content-addressed store, hash-verified

324// ─── CREATE TABLE ─────────────────────────────────────────────────────────────
325
326func 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
344func TestRenderCreateTable_AllFeatures(t *testing.T) {
345 stmt := &ast.CreateTableStatement{

Callers

nothing calls this directly

Calls 3

ReadableStyleFunction · 0.92
fmtStmtFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected