From 4e78a1c2b810a54fa8baf82f174ceae7f6c57bb9 Mon Sep 17 00:00:00 2001 From: loki5512344 Date: Tue, 15 Sep 2026 18:33:24 +0200 Subject: [PATCH] test(dir): compare planned paths via rel_str so Windows backslash display cannot leak into assertions --- src/core/plan/dir.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/plan/dir.rs b/src/core/plan/dir.rs index fb02337..ef04c1c 100644 --- a/src/core/plan/dir.rs +++ b/src/core/plan/dir.rs @@ -183,10 +183,16 @@ mod tests { let index = Index::build(dir.path())?; let plan = plan_move(&index, Path::new("lib"), Path::new("core/lib"))?; assert_eq!(plan.prune_dirs, [PathBuf::from("lib")]); - let moves: Vec<(&str, &str)> = plan + // rel_str: canonical '/' display, stable across platforms. + let moves: Vec<(String, String)> = plan .moves .iter() - .map(|m| (m.source.to_str().unwrap(), m.target.to_str().unwrap())) + .map(|m| { + ( + crate::core::rel_str(&m.source), + crate::core::rel_str(&m.target), + ) + }) .collect(); assert_eq!( moves,