diff --git a/fuzz/fuzz_targets/fuzz_patch.rs b/fuzz/fuzz_targets/fuzz_patch.rs index cac6a53..d9f0630 100644 --- a/fuzz/fuzz_targets/fuzz_patch.rs +++ b/fuzz/fuzz_targets/fuzz_patch.rs @@ -22,15 +22,16 @@ fuzz_target!(|x: (Vec, Vec, u8)| { return }*/ fs::create_dir_all("target").unwrap(); + let patched = "target/fuzz.file"; let diff = unified_diff::diff( &from, &to, &Params { - from: "a/fuzz.file".into(), - to: "target/fuzz.file".into(), + from: patched.into(), + to: patched.into(), context_count: context as usize, ..Default::default() - } + }, ); File::create("target/fuzz.file.original") .unwrap() diff --git a/src/context_diff.rs b/src/context_diff.rs index 873fc3d..010c1ce 100644 --- a/src/context_diff.rs +++ b/src/context_diff.rs @@ -429,12 +429,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alef"); let diff = diff( &alef, &bet, &Params { - from: "a/alef".into(), - to: (&format!("{target}/alef")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -510,12 +511,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alef_"); let diff = diff( &alef, &bet, &Params { - from: "a/alef_".into(), - to: (&format!("{target}/alef_")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -594,12 +596,13 @@ mod tests { }; // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alefx"); let diff = diff( &alef, &bet, &Params { - from: "a/alefx".into(), - to: (&format!("{target}/alefx")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -681,12 +684,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let alefr_path = &format!("{target}/alefr"); let diff = diff( &alef, &bet, &Params { - from: "a/alefr".into(), - to: (&format!("{target}/alefr")).into(), + from: alefr_path.into(), + to: alefr_path.into(), context_count: 2, ..Default::default() }, diff --git a/src/unified_diff.rs b/src/unified_diff.rs index 0f504a8..6cb8b7a 100644 --- a/src/unified_diff.rs +++ b/src/unified_diff.rs @@ -456,12 +456,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alef"); let diff = diff( &alef, &bet, &Params { - from: "a/alef".into(), - to: (&format!("{target}/alef")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -572,12 +573,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alefn"); let diff = diff( &alef, &bet, &Params { - from: "a/alefn".into(), - to: (&format!("{target}/alefn")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -668,12 +670,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alef_"); let diff = diff( &alef, &bet, &Params { - from: "a/alef_".into(), - to: (&format!("{target}/alef_")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -749,12 +752,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alefx"); let diff = diff( &alef, &bet, &Params { - from: "a/alefx".into(), - to: (&format!("{target}/alefx")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() }, @@ -835,12 +839,13 @@ mod tests { } // This test diff is intentionally reversed. // We want it to turn the alef into bet. + let patched = &format!("{target}/alefr"); let diff = diff( &alef, &bet, &Params { - from: "a/alefr".into(), - to: (&format!("{target}/alefr")).into(), + from: patched.into(), + to: patched.into(), context_count: 2, ..Default::default() },