From f651e72ef46207194736e4630b9e577cc9e56d66 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Sun, 11 Jan 2026 20:36:17 -0800 Subject: [PATCH] windows --- codex-rs/core/tests/suite/abort_tasks.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/codex-rs/core/tests/suite/abort_tasks.rs b/codex-rs/core/tests/suite/abort_tasks.rs index 2f9bfd91e5..985280533a 100644 --- a/codex-rs/core/tests/suite/abort_tasks.rs +++ b/codex-rs/core/tests/suite/abort_tasks.rs @@ -16,11 +16,15 @@ use core_test_support::wait_for_event; use serde_json::json; use std::sync::Arc; +#[cfg(windows)] +const POWERSHELL_PARTIAL_OUTPUT_SCRIPT: &str = r#"Start-Sleep -Milliseconds 200; [Console]::Out.WriteLine('partial output'); [Console]::Out.Flush(); Start-Sleep -Seconds 60"#; +#[cfg(not(windows))] +const POWERSHELL_PARTIAL_OUTPUT_SCRIPT: &str = ""; + fn long_running_exec_command_with_output() -> (String, Option<&'static str>) { if cfg!(windows) { ( - "Start-Sleep -Milliseconds 200; Write-Output 'partial output'; Start-Sleep -Seconds 60" - .to_string(), + POWERSHELL_PARTIAL_OUTPUT_SCRIPT.to_string(), Some("powershell"), ) } else { @@ -37,8 +41,7 @@ fn long_running_shell_command_with_output() -> Vec { "powershell.exe".to_string(), "-NoProfile".to_string(), "-Command".to_string(), - "Start-Sleep -Milliseconds 200; Write-Output 'partial output'; Start-Sleep -Seconds 60" - .to_string(), + POWERSHELL_PARTIAL_OUTPUT_SCRIPT.to_string(), ] } else { vec![ @@ -55,7 +58,7 @@ fn long_running_local_shell_call_with_output() -> Vec<&'static str> { "powershell.exe", "-NoProfile", "-Command", - "Start-Sleep -Milliseconds 200; Write-Output 'partial output'; Start-Sleep -Seconds 60", + POWERSHELL_PARTIAL_OUTPUT_SCRIPT, ] } else { vec![