From ffbbb374c1f28a2597922e936e174810ce39023a Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Sun, 8 Feb 2026 17:10:15 +0100 Subject: [PATCH] cli-test: Path separation compatible with Windows Running tests on Windows requires separating the path to executables by `;`. --- crates/radicle-cli-test/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/radicle-cli-test/src/lib.rs b/crates/radicle-cli-test/src/lib.rs index fafe944b..ccc8a9c5 100644 --- a/crates/radicle-cli-test/src/lib.rs +++ b/crates/radicle-cli-test/src/lib.rs @@ -170,6 +170,11 @@ pub struct TestFormula { impl TestFormula { pub fn new(cwd: PathBuf) -> Self { + #[cfg(windows)] + const PATH_SEPARATOR: char = ';'; + #[cfg(not(windows))] + const PATH_SEPARATOR: char = ':'; + Self { cwd: cwd.clone(), env: HashMap::new(), @@ -178,7 +183,8 @@ impl TestFormula { subs: Substitutions::new(), bins: env::var("PATH") .map(|env_path| { - let mut bins: Vec = env_path.split(':').map(PathBuf::from).collect(); + let mut bins: Vec = + env_path.split(PATH_SEPARATOR).map(PathBuf::from).collect(); // Add current working directory to `$PATH`, // this makes it more convenient to execute scripts during testing. bins.push(cwd);