From e327b172581cd8cfbeed4ae4f22127723dcee140 Mon Sep 17 00:00:00 2001 From: iceweasel-oai Date: Wed, 1 Jul 2026 18:28:01 -0700 Subject: [PATCH] Add regression tests for Windows :root dot warning --- codex-rs/core/src/config/permissions_tests.rs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/codex-rs/core/src/config/permissions_tests.rs b/codex-rs/core/src/config/permissions_tests.rs index 2c1f649042..03e2c6b1d7 100644 --- a/codex-rs/core/src/config/permissions_tests.rs +++ b/codex-rs/core/src/config/permissions_tests.rs @@ -43,6 +43,31 @@ fn windows_verbatim_path_prefix_does_not_count_as_glob_syntax() { )); } +#[test] +fn windows_root_dot_warning_explains_drive_root_footgun() { + let mut startup_warnings = Vec::new(); + + maybe_push_windows_root_dot_warning(":root", ".", &mut startup_warnings, /*is_windows*/ true); + + assert_eq!(startup_warnings.len(), 1); + assert!(startup_warnings[0].contains("filesystem or drive root on Windows")); + assert!(startup_warnings[0].contains(":workspace_roots")); +} + +#[test] +fn windows_root_dot_warning_is_windows_only() { + let mut startup_warnings = Vec::new(); + + maybe_push_windows_root_dot_warning( + ":root", + ".", + &mut startup_warnings, + /*is_windows*/ false, + ); + + assert!(startup_warnings.is_empty()); +} + #[tokio::test] async fn restricted_read_implicitly_allows_helper_executables() -> std::io::Result<()> { let temp_dir = TempDir::new()?;