mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-03 20:13:03 +00:00
i dont like commits
This commit is contained in:
@@ -30,7 +30,24 @@ func TestScannerRecoversDetectorPanic(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("scan should recover detector panic, got err: %v", err)
|
||||
}
|
||||
if len(result.Findings) != 1 {
|
||||
t.Fatalf("expected findings from healthy detector only, got %d", len(result.Findings))
|
||||
if len(result.Findings) != 2 {
|
||||
t.Fatalf("expected healthy finding plus detector_error, got %d", len(result.Findings))
|
||||
}
|
||||
|
||||
hasOK := false
|
||||
hasDetectorError := false
|
||||
for _, f := range result.Findings {
|
||||
if f.ID == "ok" {
|
||||
hasOK = true
|
||||
}
|
||||
if f.Type == "detector_error" {
|
||||
hasDetectorError = true
|
||||
}
|
||||
}
|
||||
if !hasOK {
|
||||
t.Fatalf("expected to keep finding from healthy detector")
|
||||
}
|
||||
if !hasDetectorError {
|
||||
t.Fatalf("expected detector_error finding for panicing detector")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user