Files
dev/codex-rs/exec-server/tests/file_system_windows.rs
zeekayandHanzo Dev 54a8eed885 port: adopt latest openai/codex codex-rs base (2026-06-16, 33d5023)
Wholesale-adopt latest upstream codex-rs (97 crates, new architecture:
model-provider-info crate, app-server-daemon/transport, code-mode-host,
thread-store, file-watcher, etc.). Hanzo-only crates (browser, debug-client,
instructions, tui2) preserved on disk (not yet re-added to workspace). Builds
clean as upstream (codex bin). Hanzo overlay (dev bin, api.hanzo.ai default,
hanzo.id/Claude login, branding) re-applied in following commits.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-16 21:24:01 -07:00

57 lines
1.6 KiB
Rust

#![cfg(windows)]
#![allow(clippy::expect_used)]
mod common;
#[path = "file_system/shared.rs"]
mod shared;
#[path = "file_system/support.rs"]
mod support;
use std::path::Path;
use std::process::Command;
use anyhow::Result;
use test_case::test_case;
use crate::support::FileSystemImplementation;
fn create_directory_junction(target: &Path, alias: &Path) -> Result<()> {
let output = Command::new("cmd")
.args(["/C", "mklink", "/J"])
.arg(alias)
.arg(target)
.output()?;
if !output.status.success() {
anyhow::bail!(
"mklink /J failed: stdout={} stderr={}",
String::from_utf8_lossy(&output.stdout).trim(),
String::from_utf8_lossy(&output.stderr).trim()
);
}
Ok(())
}
#[test_case(FileSystemImplementation::Local ; "local")]
#[test_case(FileSystemImplementation::Remote ; "remote")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn file_system_canonicalize_resolves_directory_junction(
implementation: FileSystemImplementation,
) -> Result<()> {
shared::assert_canonicalize_resolves_directory_alias(implementation, create_directory_junction)
.await
}
#[test_case(FileSystemImplementation::Local ; "local")]
#[test_case(FileSystemImplementation::Remote ; "remote")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn file_system_sandboxed_canonicalize_resolves_directory_junction(
implementation: FileSystemImplementation,
) -> Result<()> {
shared::assert_sandboxed_canonicalize_resolves_directory_alias(
implementation,
create_directory_junction,
)
.await
}