(t *testing.T)
| 240 | } |
| 241 | |
| 242 | func TestSecurityScanInternal_CleanSQL(t *testing.T) { |
| 243 | data, err := securityScanInternal("SELECT id FROM users WHERE id = 42") |
| 244 | if err != nil { |
| 245 | t.Fatalf("unexpected error: %v", err) |
| 246 | } |
| 247 | if data["is_clean"] != true { |
| 248 | t.Error("expected is_clean=true for benign SQL") |
| 249 | } |
| 250 | if data["total_count"] != 0 { |
| 251 | t.Errorf("expected 0 findings, got %v", data["total_count"]) |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | func TestSecurityScanInternal_InjectionDetected(t *testing.T) { |
| 256 | data, err := securityScanInternal("SELECT * FROM users WHERE 1=1 OR ''=''") |
nothing calls this directly
no test coverage detected