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

Function TestRequireInvalidSQL_Valid

pkg/gosqlx/testing/testing_test.go:124–135  ·  view source on GitHub ↗

Test RequireInvalidSQL with valid SQL

(t *testing.T)

Source from the content-addressed store, hash-verified

122
123// Test RequireInvalidSQL with valid SQL
124func TestRequireInvalidSQL_Valid(t *testing.T) {
125 mockT := &mockTestingT{}
126
127 RequireInvalidSQL(mockT, "SELECT * FROM users")
128
129 if !mockT.fataled {
130 t.Error("RequireInvalidSQL should fatal for valid SQL")
131 }
132 if !strings.Contains(mockT.fatalMsg, "Required invalid SQL") {
133 t.Errorf("Fatal message should be descriptive, got: %s", mockT.fatalMsg)
134 }
135}
136
137// Test AssertFormattedSQL with matching format
138func TestAssertFormattedSQL_Matching(t *testing.T) {

Callers

nothing calls this directly

Calls 3

RequireInvalidSQLFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected