From ba467b2b726c5eb49d02a78ef2679a45a62cd8e0 Mon Sep 17 00:00:00 2001 From: "p.illmer" <78146483+Testsubject1337@users.noreply.github.com> Date: Fri, 16 Oct 2026 02:34:31 +0200 Subject: [PATCH] fix(engine): compile Windows tests (#571) `cargo xtask ci` failed on Windows before any test ran: the `windows_ignores_case_and_refuses_devices` test moved `upper` into `check` and borrowed it afterwards for the assertion message (E0382), and the recovery test's `paths` is only mutated inside its `#[cfg(unix)]` symlink block, so `-D warnings` rejected the `mut` everywhere else. Neither test is compiled on macOS or Linux, which is why CI never saw them. With this, `cargo xtask ci` passes on Windows 11 (MSVC, Rust 1.99). Co-authored-by: Claude Fable 5.1 --- crates/engine/src/autosave.rs | 2 ++ crates/engine/src/file_access.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/autosave.rs b/crates/engine/src/autosave.rs index d42e81fd..cb7faac1 100644 --- a/crates/engine/src/autosave.rs +++ b/crates/engine/src/autosave.rs @@ -557,6 +557,8 @@ mod tests { std::fs::create_dir_all(path.parent().unwrap()).unwrap(); std::fs::write(path, bytes).unwrap(); } + // Only the symlink case below adds to it, and symlinks are a Unix-only part of the test. + #[cfg_attr(not(unix), allow(unused_mut))] let mut paths: Vec = files.iter().map(|(p, _)| p.clone()).collect(); #[cfg(unix)] { diff --git a/crates/engine/src/file_access.rs b/crates/engine/src/file_access.rs index b0f02fd3..1f1a0c5f 100644 --- a/crates/engine/src/file_access.rs +++ b/crates/engine/src/file_access.rs @@ -398,7 +398,7 @@ mod tests { fn windows_ignores_case_and_refuses_devices() { let (base, roots) = folders("case"); let upper = s(base.join("IN/a.scraft")); - assert_eq!(roots.check(upper, Access::Read), Ok(()), "{upper}"); + assert_eq!(roots.check(&upper, Access::Read), Ok(()), "{upper}"); assert_eq!(roots.check(s(base.join("In/Sub/New.scraft")), Access::Read), Ok(())); let e = roots.check(s(base.join("out/NUL")), Access::Write).unwrap_err(); assert!(e.contains("reserved device names"), "{e}");