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

Function TestAssertColumns_InvalidSQL

pkg/gosqlx/testing/testing_test.go:316–330  ·  view source on GitHub ↗

Test AssertColumns with invalid SQL

(t *testing.T)

Source from the content-addressed store, hash-verified

314
315// Test AssertColumns with invalid SQL
316func TestAssertColumns_InvalidSQL(t *testing.T) {
317 mockT := &mockTestingT{}
318
319 result := AssertColumns(mockT, "SELECT FROM WHERE", []string{"id"})
320
321 if result {
322 t.Error("AssertColumns should return false for invalid SQL")
323 }
324 if !mockT.failed {
325 t.Error("AssertColumns should fail for invalid SQL")
326 }
327 if !strings.Contains(mockT.errorMsg, "Failed to parse SQL") {
328 t.Errorf("Error message should indicate parse failure, got: %s", mockT.errorMsg)
329 }
330}
331
332// Test AssertParsesTo with correct type
333func TestAssertParsesTo_Correct(t *testing.T) {

Callers

nothing calls this directly

Calls 3

AssertColumnsFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected