From 44f52f4c18290059931d2d7bec37c0eba42ee75f Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Sat, 14 Feb 2026 00:12:18 +0100 Subject: [PATCH] cli-test: Fix uses of `PATH_SEPARATOR` Some occurrences of ":" literals were missed earlier. --- crates/radicle-cli-test/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/radicle-cli-test/src/lib.rs b/crates/radicle-cli-test/src/lib.rs index 83facd69..6c73f7f1 100644 --- a/crates/radicle-cli-test/src/lib.rs +++ b/crates/radicle-cli-test/src/lib.rs @@ -10,6 +10,11 @@ use snapbox::cmd::{Command, OutputAssert}; use snapbox::{Assert, Substitutions}; use thiserror::Error; +#[cfg(windows)] +const PATH_SEPARATOR: char = ';'; +#[cfg(not(windows))] +const PATH_SEPARATOR: char = ':'; + /// Used to ensure the build task is only run once. static BUILD: sync::Once = sync::Once::new(); @@ -170,11 +175,6 @@ 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(), @@ -492,7 +492,7 @@ impl TestFormula { .iter() .map(|p| p.as_os_str()) .collect::>() - .join(ffi::OsStr::new(":")); + .join(ffi::OsStr::new(&PATH_SEPARATOR.to_string())); let result = Command::new(cmd.clone()) .env_clear() .env("PATH", &bins) @@ -584,7 +584,7 @@ $ rad sync bins: { let mut bins: Vec<_> = env::var("PATH") .unwrap_or_default() - .split(':') + .split(PATH_SEPARATOR) .map(PathBuf::from) .collect(); bins.push(cwd);