(t *testing.T)
| 317 | } |
| 318 | |
| 319 | func TestLintSQLInternal_WithViolations(t *testing.T) { |
| 320 | data, err := lintSQLInternal("select id from users \n") |
| 321 | if err != nil { |
| 322 | t.Fatalf("unexpected error: %v", err) |
| 323 | } |
| 324 | violations, ok := data["violations"].([]map[string]any) |
| 325 | if !ok { |
| 326 | t.Fatal("expected violations to be []map[string]any") |
| 327 | } |
| 328 | if len(violations) == 0 { |
| 329 | t.Error("expected lint violations for trailing whitespace / keyword case") |
| 330 | } |
| 331 | v := violations[0] |
| 332 | for _, key := range []string{"rule", "rule_name", "severity", "message", "line", "column", "suggestion"} { |
| 333 | if _, ok := v[key]; !ok { |
| 334 | t.Errorf("violation missing key %q", key) |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | // --- toolResult --- |
| 340 |
nothing calls this directly
no test coverage detected