Skip to content

Commit f63082f

Browse files
authored
test(sign-out): join listed paths with / so the tests pass on Windows (#1247)
Signed-off-by: Virgile Pourchet <[email protected]>
1 parent abdc0e4 commit f63082f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎src-tauri/src/sign_out/tests.rs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ fn walk(root: &Path, dir: &Path) -> Vec<String> {
8181
.unwrap()
8282
.flat_map(|entry| {
8383
let path = entry.unwrap().path();
84-
let name = path.strip_prefix(root).unwrap().display().to_string();
84+
// Joined with `/` so the expected listings hold on Windows too,
85+
// where `display()` would use `\`.
86+
let name = path
87+
.strip_prefix(root)
88+
.unwrap()
89+
.components()
90+
.map(|part| part.as_os_str().to_string_lossy())
91+
.collect::<Vec<_>>()
92+
.join("/");
8593
if path.is_dir() {
8694
let mut nested = walk(root, &path);
8795
nested.push(format!("{name}/"));

0 commit comments

Comments
 (0)