Skip to content

Commit

Permalink
fix: fix tests failed on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jan 12, 2024
1 parent bf88b3b commit a5e2a10
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/object-store/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,20 @@ pub fn join_dir(parent: &str, child: &str) -> String {
// Always adds a `/` to the output path.
let output = format!("{parent}/{child}/");
// We call opendal's normalize_root which keep the last `/`.
opendal::raw::normalize_root(&output)
#[cfg(not(windows))]
{
opendal::raw::normalize_root(&output)
}

#[cfg(windows)]
{
let path = opendal::raw::normalize_root(&output);
if path.starts_with('/') {
path.trim_start_matches('/').to_string()
} else {
path
}
}
}

/// Push `child` to `parent` dir and normalize the output path.
Expand Down

0 comments on commit a5e2a10

Please sign in to comment.