Skip to content

Commit

Permalink
add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Jan 23, 2024
1 parent 1372c53 commit f5b65a5
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/unified_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,30 @@ mod tests {
fb.write_all(&bet[..]).unwrap();
let _ = fa;
let _ = fb;
println!(
"diff: {:?}",
String::from_utf8(diff.clone())
.unwrap_or_else(|_| String::from("[Invalid UTF-8]"))
);
println!(
"alef: {:?}",
String::from_utf8(alef.clone())
.unwrap_or_else(|_| String::from("[Invalid UTF-8]"))
);
println!(
"bet: {:?}",
String::from_utf8(bet.clone())
.unwrap_or_else(|_| String::from("[Invalid UTF-8]"))
);

let output = Command::new("patch")
.arg("-p0")
.stdin(File::open(&format!("{target}/ab.diff")).unwrap())
.output()
.unwrap();
println!("{}", String::from_utf8_lossy(&output.stdout));
println!("{}", String::from_utf8_lossy(&output.stderr));
assert!(output.status.success(), "{:?}", output);
//println!("{}", String::from_utf8_lossy(&output.stdout));
//println!("{}", String::from_utf8_lossy(&output.stderr));
let alef = fs::read(&format!("{target}/alef")).unwrap();
assert_eq!(alef, bet);
}
Expand Down

0 comments on commit f5b65a5

Please sign in to comment.