Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

i18n: the tl! source scan in tests passes on CRLF checkouts

ReReddo63fe547f700f
diff --git a/crates/ui-egui/src/i18n/mod.rs b/crates/ui-egui/src/i18n/mod.rs
index c04416c6a..8a0b89964 100644
--- a/crates/ui-egui/src/i18n/mod.rs
+++ b/crates/ui-egui/src/i18n/mod.rs
@@ -368,7 +368,8 @@ mod tests {
if p.is_dir() {
dirs.push(p);
} else if p.extension().is_some_and(|e| e == "rs") {
- let text = std::fs::read_to_string(&p).unwrap_or_default();
+ // a Windows checkout with core.autocrlf has CRLF, which the `\n` below would not match
+ let text = std::fs::read_to_string(&p).unwrap_or_default().replace("\r\n", "\n");
let cut = text.find("#[cfg(test)]\nmod tests").unwrap_or(text.len());
out.push((p.display().to_string(), text[..cut].to_string()));
}