Skip to content

Commit dd24914

Browse files
committed
fix: use USERPROFILE on Windows for legacy config test
1 parent d2351ff commit dd24914

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/config.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,18 @@ install_dir = "/legacy/bin"
7474
)
7575
.unwrap();
7676

77-
// Mock home directory
77+
// Mock home directory - use USERPROFILE on Windows, HOME on Unix
78+
#[cfg(windows)]
79+
env::set_var("USERPROFILE", home);
80+
#[cfg(not(windows))]
7881
env::set_var("HOME", home);
7982

8083
let config = Config::load_from_legacy().unwrap().unwrap();
8184
assert_eq!(config.install_dir, PathBuf::from("/legacy/bin"));
8285

86+
#[cfg(windows)]
87+
env::remove_var("USERPROFILE");
88+
#[cfg(not(windows))]
8389
env::remove_var("HOME");
8490
}
8591

0 commit comments

Comments
 (0)