diff --git a/fuzz/fuzz_targets/fuzz_ed.rs b/fuzz/fuzz_targets/fuzz_ed.rs index 5c5132e..3c10482 100644 --- a/fuzz/fuzz_targets/fuzz_ed.rs +++ b/fuzz/fuzz_targets/fuzz_ed.rs @@ -2,17 +2,10 @@ #[macro_use] extern crate libfuzzer_sys; use diffutilslib::ed_diff; -use diffutilslib::ed_diff::DiffError; use std::fs::{self, File}; use std::io::Write; use std::process::Command; -fn diff_w(expected: &[u8], actual: &[u8], filename: &str) -> Result, DiffError> { - let mut output = ed_diff::diff(expected, actual)?; - writeln!(&mut output, "w {filename}").unwrap(); - Ok(output) -} - fuzz_target!(|x: (Vec, Vec)| { let (mut from, mut to) = x; from.push(b'\n'); @@ -37,7 +30,7 @@ fuzz_target!(|x: (Vec, Vec)| { } else { return; } - let diff = diff_w(&from, &to, "target/fuzz.file").unwrap(); + let diff = ed_diff::diff(&from, &to, true).unwrap(); File::create("target/fuzz.file.original") .unwrap() .write_all(&from) diff --git a/fuzz/fuzz_targets/fuzz_normal.rs b/fuzz/fuzz_targets/fuzz_normal.rs index a44ece3..0118e28 100644 --- a/fuzz/fuzz_targets/fuzz_normal.rs +++ b/fuzz/fuzz_targets/fuzz_normal.rs @@ -21,7 +21,7 @@ fuzz_target!(|x: (Vec, Vec)| { } else { return }*/ - let diff = normal_diff::diff(&from, &to); + let diff = normal_diff::diff(&from, &to, true); File::create("target/fuzz.file.original") .unwrap() .write_all(&from) diff --git a/fuzz/fuzz_targets/fuzz_patch.rs b/fuzz/fuzz_targets/fuzz_patch.rs index d353523..de97bb0 100644 --- a/fuzz/fuzz_targets/fuzz_patch.rs +++ b/fuzz/fuzz_targets/fuzz_patch.rs @@ -26,6 +26,7 @@ fuzz_target!(|x: (Vec, Vec, u8)| { &to, "target/fuzz.file", context as usize, + true ); File::create("target/fuzz.file.original") .unwrap()