From 3b4b168cb056dfc41ced9e68d5a43e8384cbcf99 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Tue, 28 Apr 2026 19:12:13 -0700 Subject: [PATCH] test(cli): cover sandbox full-auto removal Co-authored-by: Codex noreply@openai.com --- codex-rs/cli/src/main.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index 3bda015659..4a5bddb298 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -1986,18 +1986,22 @@ mod tests { } #[test] - fn sandbox_macos_rejects_full_auto() { - let err = MultitoolCli::try_parse_from(["codex", "sandbox", "macos", "--full-auto"]) - .expect_err("parse should fail"); + fn sandbox_subcommands_reject_full_auto() { + for subcommand in ["macos", "linux", "windows"] { + let err = MultitoolCli::try_parse_from(["codex", "sandbox", subcommand, "--full-auto"]) + .expect_err("parse should fail"); - assert_eq!(err.kind(), clap::error::ErrorKind::UnknownArgument); + assert_eq!(err.kind(), clap::error::ErrorKind::UnknownArgument); + } } #[test] - fn sandbox_macos_help_omits_full_auto() { - let help = help_from_args(&["codex", "sandbox", "macos", "--help"]); + fn sandbox_subcommand_help_omits_full_auto() { + for subcommand in ["macos", "linux", "windows"] { + let help = help_from_args(&["codex", "sandbox", subcommand, "--help"]); - assert!(!help.contains("--full-auto"), "{help}"); + assert!(!help.contains("--full-auto"), "{help}"); + } } #[test]