Skip to content

Commit

Permalink
ignore differences between LF and CRLF (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunchen authored Aug 28, 2024
1 parent 901ac07 commit f352978
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/moonbuild/src/expect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,10 @@ pub fn snapshot_eq(msg: &str) -> anyhow::Result<bool> {
} else {
"".to_string()
};
let eq = actual == expect;
fn normalize_string(s: &str) -> String {
s.replace("\r\n", "\n").replace('\r', "")
}
let eq = normalize_string(&actual) == normalize_string(&expect);
Ok(eq)
}

Expand Down

0 comments on commit f352978

Please sign in to comment.