This directory contains fuzz tests for imara-diff using cargo-fuzz.
- Nightly Rust toolchain:
rustup install nightly - cargo-fuzz:
cargo install cargo-fuzz
# Run for a specific time (e.g., 60 seconds)
cargo +nightly fuzz run comprehensive_diff -- -max_total_time=60
# Run with a specific number of runs
cargo +nightly fuzz run comprehensive_diff -- -runs=1000000for target in comprehensive_diff diff_compute_with postprocess_heuristics unified_diff_printer; do
cargo +nightly fuzz run --release $target -- -max_total_time=60
donecargo +nightly fuzz coverage comprehensive_diffFuzz tests are automatically run in CI for 3 minutes total (45 seconds per target × 4 targets) to ensure no regressions in robustness.
- Create a new file in
fuzz_targets/directory - Add a new
[[bin]]entry inCargo.toml - Update the CI workflow to run the new target
- Update this README with a description of the new target