Test AssertFormattedSQL with non-matching format
(t *testing.T)
| 153 | |
| 154 | // Test AssertFormattedSQL with non-matching format |
| 155 | func TestAssertFormattedSQL_NotMatching(t *testing.T) { |
| 156 | mockT := &mockTestingT{} |
| 157 | |
| 158 | sql := "SELECT * FROM users" |
| 159 | expected := "SELECT * FROM orders" |
| 160 | result := AssertFormattedSQL(mockT, sql, expected) |
| 161 | |
| 162 | if result { |
| 163 | t.Error("AssertFormattedSQL should return false for non-matching format") |
| 164 | } |
| 165 | if !mockT.failed { |
| 166 | t.Error("AssertFormattedSQL should fail for non-matching format") |
| 167 | } |
| 168 | if !strings.Contains(mockT.errorMsg, "does not match expected") { |
| 169 | t.Errorf("Error message should be descriptive, got: %s", mockT.errorMsg) |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | // Test AssertFormattedSQL with invalid SQL |
| 174 | func TestAssertFormattedSQL_InvalidSQL(t *testing.T) { |
nothing calls this directly
no test coverage detected