Skip to content

Commit ca35073

Browse files
committed
fix(cli): gate ProfileEnvGuard and implode tests behind cfg(not(windows))
1 parent 80123f4 commit ca35073

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/vite_global_cli/src/commands/implode.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ mod tests {
457457
}
458458

459459
#[test]
460+
#[cfg(not(windows))]
460461
fn test_abbreviate_home_path() {
461462
let home = AbsolutePathBuf::new("/home/user".into()).unwrap();
462463
// Under home → ~/...
@@ -469,6 +470,7 @@ mod tests {
469470

470471
#[test]
471472
#[serial]
473+
#[cfg(not(windows))]
472474
fn test_collect_affected_profiles() {
473475
let temp_dir = tempfile::tempdir().unwrap();
474476
let home = AbsolutePathBuf::new(temp_dir.path().to_path_buf()).unwrap();
@@ -492,11 +494,13 @@ mod tests {
492494
}
493495

494496
/// Guard that saves and restores ZDOTDIR and XDG_CONFIG_HOME env vars.
497+
#[cfg(not(windows))]
495498
struct ProfileEnvGuard {
496499
original_zdotdir: Option<std::ffi::OsString>,
497500
original_xdg_config: Option<std::ffi::OsString>,
498501
}
499502

503+
#[cfg(not(windows))]
500504
impl ProfileEnvGuard {
501505
fn new(zdotdir: Option<&std::path::Path>, xdg_config: Option<&std::path::Path>) -> Self {
502506
let guard = Self {
@@ -517,6 +521,7 @@ mod tests {
517521
}
518522
}
519523

524+
#[cfg(not(windows))]
520525
impl Drop for ProfileEnvGuard {
521526
fn drop(&mut self) {
522527
unsafe {
@@ -534,6 +539,7 @@ mod tests {
534539

535540
#[test]
536541
#[serial]
542+
#[cfg(not(windows))]
537543
fn test_collect_affected_profiles_zdotdir() {
538544
let temp_dir = tempfile::tempdir().unwrap();
539545
let home = AbsolutePathBuf::new(temp_dir.path().join("home")).unwrap();
@@ -554,6 +560,7 @@ mod tests {
554560

555561
#[test]
556562
#[serial]
563+
#[cfg(not(windows))]
557564
fn test_collect_affected_profiles_xdg_config() {
558565
let temp_dir = tempfile::tempdir().unwrap();
559566
let home = AbsolutePathBuf::new(temp_dir.path().join("home")).unwrap();

0 commit comments

Comments
 (0)