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

Function TestProtocol_CallTool_LintSQL

pkg/mcp/protocol_test.go:215–233  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestProtocol_CallTool_LintSQL(t *testing.T) {
216 c := newInProcessClient(t)
217 ctx := context.Background()
218
219 req := mcpmcp.CallToolRequest{}
220 req.Params.Name = "lint_sql"
221 req.Params.Arguments = map[string]any{"sql": "select id from users \n"}
222
223 result, err := c.CallTool(ctx, req)
224 if err != nil {
225 t.Fatalf("CallTool lint_sql: %v", err)
226 }
227
228 data := extractProtocolResult(t, result)
229 count, ok := data["violation_count"].(float64)
230 if !ok || count == 0 {
231 t.Error("expected lint violations for trailing whitespace / keyword case")
232 }
233}
234
235func TestProtocol_CallTool_AnalyzeSQL(t *testing.T) {
236 c := newInProcessClient(t)

Callers

nothing calls this directly

Calls 4

newInProcessClientFunction · 0.85
extractProtocolResultFunction · 0.85
FatalfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected