);
}
)"##;
// Create patches to transform source into target
let patches = dmp.patch_make(PatchInput::Texts::(source, target))?;
// Apply the patches to the source string
let (patched, results) = dmp.patch_apply(&patches, source)?;
// Verify all patches were applied successfully
assert!(results.iter().all(|&result| result));
// Verify the patched string equals the target
assert_eq!(target, patched);
// Also test with Compat mode
let patches_compat = dmp.patch_make(PatchInput::Texts::(source, target))?;
let (patched_compat, results_compat) = dmp.patch_apply(&patches_compat, source)?;
assert!(results_compat.iter().all(|&result| result));
assert_eq!(target, patched_compat);
Ok(())
}