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

Function TestAssertInvalidSQL_Valid

pkg/gosqlx/testing/testing_test.go:71–85  ·  view source on GitHub ↗

Test AssertInvalidSQL with valid SQL

(t *testing.T)

Source from the content-addressed store, hash-verified

69
70// Test AssertInvalidSQL with valid SQL
71func TestAssertInvalidSQL_Valid(t *testing.T) {
72 mockT := &mockTestingT{}
73
74 result := AssertInvalidSQL(mockT, "SELECT * FROM users")
75
76 if result {
77 t.Error("AssertInvalidSQL should return false for valid SQL")
78 }
79 if !mockT.failed {
80 t.Error("AssertInvalidSQL should fail for valid SQL")
81 }
82 if !strings.Contains(mockT.errorMsg, "Expected invalid SQL") {
83 t.Errorf("Error message should be descriptive, got: %s", mockT.errorMsg)
84 }
85}
86
87// Test RequireValidSQL with valid SQL
88func TestRequireValidSQL_Valid(t *testing.T) {

Callers

nothing calls this directly

Calls 3

AssertInvalidSQLFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected