Context
render_progress_bar(percent, width, use_color) in rust/src/cli/usage.rs:548 renders an ASCII bar of █/░ inside [...], clamping non-finite/out-of-range input. With use_color = false it is fully deterministic. usage.rs already has a #[cfg(test)] mod tests, so new cases slot right in.
Task
Add unit tests for render_progress_bar in the existing test module.
Acceptance criteria
- With
use_color = false: assert exact strings for 0%, 50%, 100% at a fixed width (e.g. 10).
- Assert non-finite input (
f64::NAN) renders as empty (0%).
- Assert
>100 clamps to full and <0 clamps to empty.
- No ANSI codes asserted for the
use_color = false path.
How to test
cargo test --manifest-path rust/Cargo.toml
Pointers
Context
render_progress_bar(percent, width, use_color)inrust/src/cli/usage.rs:548renders an ASCII bar of█/░inside[...], clamping non-finite/out-of-range input. Withuse_color = falseit is fully deterministic.usage.rsalready has a#[cfg(test)] mod tests, so new cases slot right in.Task
Add unit tests for
render_progress_barin the existing test module.Acceptance criteria
use_color = false: assert exact strings for0%,50%,100%at a fixedwidth(e.g. 10).f64::NAN) renders as empty (0%).>100clamps to full and<0clamps to empty.use_color = falsepath.How to test
Pointers
rust/src/cli/usage.rs:548; existing tests: same file,#[cfg(test)] mod tests.