Test AssertFormattedSQL with matching format
(t *testing.T)
| 136 | |
| 137 | // Test AssertFormattedSQL with matching format |
| 138 | func TestAssertFormattedSQL_Matching(t *testing.T) { |
| 139 | mockT := &mockTestingT{} |
| 140 | |
| 141 | // AST-based formatting with default options (IndentSize=2) produces multi-line output |
| 142 | sql := "SELECT * FROM users" |
| 143 | expected := "SELECT *\nFROM users" |
| 144 | result := AssertFormattedSQL(mockT, sql, expected) |
| 145 | |
| 146 | if !result { |
| 147 | t.Error("AssertFormattedSQL should return true for matching format") |
| 148 | } |
| 149 | if mockT.failed { |
| 150 | t.Errorf("AssertFormattedSQL should not fail for matching format, got: %s", mockT.errorMsg) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | // Test AssertFormattedSQL with non-matching format |
| 155 | func TestAssertFormattedSQL_NotMatching(t *testing.T) { |
nothing calls this directly
no test coverage detected