diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-10 21:16:06 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-10 21:16:06 +0300 |
| commit | 7d6eaf5f26d1fa93b9c95c0457d43183f989fab9 (patch) | |
| tree | 0d76785bc13aefa693eb8be2afb7571a3199f3f6 /src/worktree.rs | |
| parent | 9ae03dddb94d24d02d0bd1776868a5497433abf1 (diff) | |
test: fix windows tilde env provider
Diffstat (limited to 'src/worktree.rs')
| -rw-r--r-- | src/worktree.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/worktree.rs b/src/worktree.rs index 70391470..d345f337 100644 --- a/src/worktree.rs +++ b/src/worktree.rs @@ -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, |
