TestSQLFormatter_ErrorHandling tests error handling
(t *testing.T)
| 480 | |
| 481 | // TestSQLFormatter_ErrorHandling tests error handling |
| 482 | func TestSQLFormatter_ErrorHandling(t *testing.T) { |
| 483 | t.Run("empty AST", func(t *testing.T) { |
| 484 | formatter := NewSQLFormatter(FormatterOptions{ |
| 485 | Indent: " ", |
| 486 | }) |
| 487 | |
| 488 | astObj := ast.NewAST() |
| 489 | defer ast.ReleaseAST(astObj) |
| 490 | |
| 491 | output, err := formatter.Format(astObj) |
| 492 | // Empty AST should produce empty output or error |
| 493 | if err == nil && output != "" { |
| 494 | t.Errorf("Expected empty output for empty AST, got: %s", output) |
| 495 | } |
| 496 | }) |
| 497 | } |
| 498 | |
| 499 | // TestSQLFormatter_Options tests different formatter options |
| 500 | func TestSQLFormatter_Options(t *testing.T) { |
nothing calls this directly
no test coverage detected