diff --git a/codex-rs/core/src/tools/handlers/unified_exec.rs b/codex-rs/core/src/tools/handlers/unified_exec.rs index f2500a413b..04969b0238 100644 --- a/codex-rs/core/src/tools/handlers/unified_exec.rs +++ b/codex-rs/core/src/tools/handlers/unified_exec.rs @@ -309,8 +309,9 @@ mod tests { let command = get_command(&args); - assert_eq!(command.len(), 3); - assert_eq!(command[2], "echo hello"); + let expected_command_len = if cfg!(windows) { 4 } else { 3 }; + assert_eq!(command.len(), expected_command_len); + assert_eq!(command.last().unwrap(), "echo hello"); } #[test] @@ -338,7 +339,7 @@ mod tests { let command = get_command(&args); - assert_eq!(command[2], "echo hello"); + assert_eq!(command.last().unwrap(), "echo hello"); } #[test]