Skip to content

Commit

Permalink
Merge pull request #10 from samestep/filename
Browse files Browse the repository at this point in the history
Report differing file names
  • Loading branch information
calder authored Sep 8, 2024
2 parents a8f8770 + a8d1e81 commit bb0fdbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/differs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ pub fn text_diff(old: &Path, new: &Path) {
similar_asserts::assert_eq!(
&fs::read_to_string(old).unwrap_or("".to_string()),
&fs::read_to_string(new).unwrap_or("".to_string()),
"{}",
old.display(),
);
}

Expand All @@ -35,7 +37,7 @@ pub fn binary_diff(old: &Path, new: &Path) {
.position(|(old_byte, new_byte)| old_byte != new_byte);

if let Some(position) = first_difference {
panic!("Files differ at byte {}", position + 1);
panic!("{}: Files differ at byte {}", old.display(), position + 1);
}
}

Expand Down

0 comments on commit bb0fdbb

Please sign in to comment.