Skip to content

Commit d549156

Browse files
committed
feat(afl): show corpus initialization as [i] instead of [+]
1 parent 6ed295c commit d549156

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

packages/fuzzer/rust/src/lib.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,26 @@ fn build_progress_snapshot(
347347
})
348348
}
349349

350+
fn progress_marker(event: StatusEvent, in_campaign: bool, colors_enabled: bool) -> String {
351+
let marker = if matches!(event, StatusEvent::Testcase) && !in_campaign {
352+
"[i]"
353+
} else {
354+
marker_text(event)
355+
};
356+
357+
colorize_marker(marker, event_color_code(event), colors_enabled)
358+
}
359+
350360
fn format_progress_line(
351361
event: StatusEvent,
352362
snapshot: ProgressSnapshot,
353363
colors_enabled: bool,
354-
highlight_full_line: bool,
364+
in_campaign: bool,
355365
) -> String {
356-
let marker = if colors_enabled && !highlight_full_line {
357-
marker_for_event(event, true)
366+
let marker = if colors_enabled && !in_campaign {
367+
progress_marker(event, false, true)
358368
} else {
359-
marker_text(event).to_string()
369+
progress_marker(event, in_campaign, false)
360370
};
361371
let line = format!(
362372
"{} #{:<width$} | edges: {} | corp: {:>4} | exec/s: {:>8.1} | obj: {:>3} | stab: {} | t: {}",
@@ -375,7 +385,7 @@ fn format_progress_line(
375385
width = EXECUTION_FIELD_WIDTH,
376386
);
377387

378-
if colors_enabled && highlight_full_line {
388+
if colors_enabled && in_campaign {
379389
format!("\x1b[{}m{}\x1b[0m", event_color_code(event), line)
380390
} else {
381391
line

tests/engine/engine.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe("Engine selection", () => {
120120
);
121121

122122
expect(status).toBe(0);
123-
const testcaseLine = findOutputLine(output, "[+]");
123+
const testcaseLine = findOutputLine(output, "[i]");
124124
const heartbeatLine = findOutputLine(output, "[*]");
125125

126126
expect(testcaseLine).toBeDefined();
@@ -184,7 +184,7 @@ describe("Engine selection", () => {
184184
expect(initOutput).not.toContain("[*]");
185185
const testcaseLines = initOutput
186186
.split(/\r?\n/)
187-
.filter((line) => line.startsWith("[+]"));
187+
.filter((line) => line.startsWith("[i]"));
188188

189189
expect(testcaseLines).toHaveLength(4);
190190
expect(testcaseLines[0]).toContain("| corp: 1 |");

0 commit comments

Comments
 (0)