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

Function TestHandler_SignatureHelp

pkg/lsp/handler_test.go:171–299  ·  view source on GitHub ↗

TestHandler_SignatureHelp tests function signature help

(t *testing.T)

Source from the content-addressed store, hash-verified

169
170// TestHandler_SignatureHelp tests function signature help
171func TestHandler_SignatureHelp(t *testing.T) {
172 tests := []struct {
173 name string
174 sql string
175 position Position
176 expectSignature bool
177 expectedFunc string
178 expectedParam int
179 }{
180 {
181 name: "COUNT function returns signature",
182 sql: "SELECT COUNT(*) FROM users",
183 position: Position{Line: 0, Character: 13}, // Inside COUNT(*)
184 expectSignature: true,
185 expectedFunc: "COUNT",
186 expectedParam: 0,
187 },
188 {
189 name: "SUM function returns signature",
190 sql: "SELECT SUM(amount) FROM orders",
191 position: Position{Line: 0, Character: 11}, // Inside SUM(
192 expectSignature: true,
193 expectedFunc: "SUM",
194 expectedParam: 0,
195 },
196 {
197 name: "AVG function returns signature",
198 sql: "SELECT AVG(salary) FROM employees",
199 position: Position{Line: 0, Character: 11}, // Inside AVG(
200 expectSignature: true,
201 expectedFunc: "AVG",
202 expectedParam: 0,
203 },
204 {
205 name: "MIN function returns signature",
206 sql: "SELECT MIN(price) FROM products",
207 position: Position{Line: 0, Character: 11}, // Inside MIN(
208 expectSignature: true,
209 expectedFunc: "MIN",
210 expectedParam: 0,
211 },
212 {
213 name: "MAX function returns signature",
214 sql: "SELECT MAX(score) FROM tests",
215 position: Position{Line: 0, Character: 11}, // Inside MAX(
216 expectSignature: true,
217 expectedFunc: "MAX",
218 expectedParam: 0,
219 },
220 {
221 name: "COALESCE with multiple parameters",
222 sql: "SELECT COALESCE(name, email, 'unknown') FROM users",
223 position: Position{Line: 0, Character: 25}, // After first comma
224 expectSignature: true,
225 expectedFunc: "COALESCE",
226 expectedParam: 1,
227 },
228 {

Callers

nothing calls this directly

Calls 8

DocumentsMethod · 0.95
newMockReadWriterFunction · 0.85
NewServerFunction · 0.85
RunMethod · 0.80
OpenMethod · 0.80
HandleRequestMethod · 0.80
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected