test: fix windows tilde env provider

This commit is contained in:
Ogulcan Celik
2026-06-10 21:16:06 +03:00
parent 9ae03dddb9
commit 7d6eaf5f26
+8 -5
View File
@@ -529,11 +529,14 @@ prunable stale
#[cfg(windows)]
#[test]
fn windows_tilde_expansion_normalizes_separators() {
let env = |key| match key {
"HOME" => Some("~".into()),
"USERPROFILE" => Some(r"C:\Users\herdr".into()),
_ => None,
};
fn env(key: &str) -> Option<OsString> {
match key {
"HOME" => Some("~".into()),
"USERPROFILE" => Some(r"C:\Users\herdr".into()),
_ => None,
}
}
let default_path = expand_tilde_path_from_env("~/.herdr/worktrees", true, env);
assert_eq!(
default_path,