TestHandler_SignatureHelp tests function signature help
(t *testing.T)
| 169 | |
| 170 | // TestHandler_SignatureHelp tests function signature help |
| 171 | func 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 | { |
nothing calls this directly
no test coverage detected