Skip to content

Commit

Permalink
fix win line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
francisdb committed Mar 16, 2024
1 parent b2142d8 commit 563c556
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vpx/expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,12 @@ mod test {
write_obj("screw".to_string(), vertices, indices, &obj_path)?;

// compare both files as strings
let original = std::fs::read_to_string(&screw_path)?;
let mut original = std::fs::read_to_string(&screw_path)?;
// When on Windows the original file will be checked out with \r\n line endings.
if cfg!(windows) {
original = original.replace("\r\n", "\n")
}
// The obj file will always be written with \n line endings.
let written = std::fs::read_to_string(&obj_path)?;
assert_eq!(original, written);
Ok(())
Expand Down

0 comments on commit 563c556

Please sign in to comment.