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

Function TestRequireValidSQL_Invalid

pkg/gosqlx/testing/testing_test.go:99–110  ·  view source on GitHub ↗

Test RequireValidSQL with invalid SQL

(t *testing.T)

Source from the content-addressed store, hash-verified

97
98// Test RequireValidSQL with invalid SQL
99func TestRequireValidSQL_Invalid(t *testing.T) {
100 mockT := &mockTestingT{}
101
102 RequireValidSQL(mockT, "SELECT FROM WHERE")
103
104 if !mockT.fataled {
105 t.Error("RequireValidSQL should fatal for invalid SQL")
106 }
107 if !strings.Contains(mockT.fatalMsg, "Required valid SQL") {
108 t.Errorf("Fatal message should be descriptive, got: %s", mockT.fatalMsg)
109 }
110}
111
112// Test RequireInvalidSQL with invalid SQL
113func TestRequireInvalidSQL_Invalid(t *testing.T) {

Callers

nothing calls this directly

Calls 3

RequireValidSQLFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected