test(dir): compare planned paths via rel_str so Windows backslash display cannot leak into assertions
This commit is contained in:
parent
6f7a2190e6
commit
4e78a1c2b8
1 changed files with 8 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue