From 090cbee9f43cd0e706f67e3bc9e9f3aacc4c5b7b Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 2 Apr 2026 22:44:46 -0400 Subject: [PATCH] Fix Windows CI: use ends_with for FakeFs paths, add cfg gate on import FakeFs on Windows prefixes paths with C:\, so exact path comparisons in test assertions fail. Use ends_with instead. Also add missing #[cfg(feature = "test-support")] gate on the FakeGitRepositoryState import in fs.rs which broke check_docs. --- crates/fs/src/fs.rs | 1 + crates/sidebar/src/sidebar_tests.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/fs/src/fs.rs b/crates/fs/src/fs.rs index 76d52cf23f5ac8f6261a098d2f979cd46d2d9ebc..c88e65878fd6430d7ac8eabc5b0c2be5de2ddb70 100644 --- a/crates/fs/src/fs.rs +++ b/crates/fs/src/fs.rs @@ -55,6 +55,7 @@ mod fake_git_repo; use collections::{BTreeMap, btree_map}; #[cfg(feature = "test-support")] pub use fake_git_repo::FakeCommitSnapshot; +#[cfg(feature = "test-support")] use fake_git_repo::FakeGitRepositoryState; #[cfg(feature = "test-support")] use git::{ diff --git a/crates/sidebar/src/sidebar_tests.rs b/crates/sidebar/src/sidebar_tests.rs index a3a80da648b653a6bf6e86b32a8d90a1f43e26da..ab539670d049877018d8bb11bdb0dfd8ce5f4e41 100644 --- a/crates/sidebar/src/sidebar_tests.rs +++ b/crates/sidebar/src/sidebar_tests.rs @@ -5042,7 +5042,7 @@ async fn test_archive_and_restore_single_worktree(cx: &mut TestAppContext) { assert!( !fs.directories(false) .iter() - .any(|p| p == std::path::Path::new("/wt-feature")), + .any(|p| p.ends_with("wt-feature")), "worktree directory should not exist before restore" ); @@ -5106,7 +5106,7 @@ async fn test_archive_and_restore_single_worktree(cx: &mut TestAppContext) { assert!( fs.directories(false) .iter() - .any(|p| p == std::path::Path::new("/wt-feature")), + .any(|p| p.ends_with("wt-feature")), "expected worktree directory to be recreated after restore, dirs: {:?}", fs.directories(false) );