From 50ce4ec2ddb8ec621a77d8773aa6df6d9e7441ff Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Sat, 5 Sep 2026 20:39:32 +0200 Subject: fix: run the full applicable test suite on windows (#3660) * fix: run the full applicable test suite on windows * test: remove redundant test shell assignment * test: make endpoint and metadata fixtures deterministic * test: tolerate exited servers during windows probe cleanup --- src/platform/mod.rs | 8 -------- src/platform/windows.rs | 33 --------------------------------- 2 files changed, 41 deletions(-) (limited to 'src/platform') diff --git a/src/platform/mod.rs b/src/platform/mod.rs index f15c71ef..402b695d 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -227,14 +227,6 @@ mod unix_common; #[cfg(unix)] pub(crate) use unix_common::{begin_cli_output, end_cli_output}; -#[cfg(not(windows))] -pub(crate) fn replace_file( - source: &std::path::Path, - destination: &std::path::Path, -) -> std::io::Result<()> { - std::fs::rename(source, destination) -} - #[cfg(not(unix))] pub(crate) fn begin_cli_output() {} diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 8d370964..10fbb6f0 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -19,39 +19,6 @@ pub(super) fn read_terminal_grid_size() -> std::io::Result<(u16, u16)> { crossterm::terminal::size() } -pub(crate) fn replace_file( - source: &std::path::Path, - destination: &std::path::Path, -) -> std::io::Result<()> { - use std::os::windows::ffi::OsStrExt; - use windows_sys::Win32::Storage::FileSystem::{ - MoveFileExW, MOVEFILE_REPLACE_EXISTING, MOVEFILE_WRITE_THROUGH, - }; - - let source = source - .as_os_str() - .encode_wide() - .chain(std::iter::once(0)) - .collect::>(); - let destination = destination - .as_os_str() - .encode_wide() - .chain(std::iter::once(0)) - .collect::>(); - let moved = unsafe { - MoveFileExW( - source.as_ptr(), - destination.as_ptr(), - MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH, - ) - }; - if moved == 0 { - Err(std::io::Error::last_os_error()) - } else { - Ok(()) - } -} - pub(crate) fn set_default_plugin_pane_pwd( _env: &mut Vec<(String, String)>, _cwd: &std::path::Path, -- cgit v1.2.3