cli-test: Fix uses of `PATH_SEPARATOR`

Some occurrences of ":" literals were missed earlier.
This commit is contained in:
Lorenz Leutgeb 2026-02-14 00:12:18 +01:00 committed by Fintan Halpenny
parent dd122f10cf
commit 44f52f4c18
1 changed files with 7 additions and 7 deletions

View File

@ -10,6 +10,11 @@ use snapbox::cmd::{Command, OutputAssert};
use snapbox::{Assert, Substitutions}; use snapbox::{Assert, Substitutions};
use thiserror::Error; 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. /// Used to ensure the build task is only run once.
static BUILD: sync::Once = sync::Once::new(); static BUILD: sync::Once = sync::Once::new();
@ -170,11 +175,6 @@ pub struct TestFormula {
impl TestFormula { impl TestFormula {
pub fn new(cwd: PathBuf) -> Self { pub fn new(cwd: PathBuf) -> Self {
#[cfg(windows)]
const PATH_SEPARATOR: char = ';';
#[cfg(not(windows))]
const PATH_SEPARATOR: char = ':';
Self { Self {
cwd: cwd.clone(), cwd: cwd.clone(),
env: HashMap::new(), env: HashMap::new(),
@ -492,7 +492,7 @@ impl TestFormula {
.iter() .iter()
.map(|p| p.as_os_str()) .map(|p| p.as_os_str())
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(ffi::OsStr::new(":")); .join(ffi::OsStr::new(&PATH_SEPARATOR.to_string()));
let result = Command::new(cmd.clone()) let result = Command::new(cmd.clone())
.env_clear() .env_clear()
.env("PATH", &bins) .env("PATH", &bins)
@ -584,7 +584,7 @@ $ rad sync
bins: { bins: {
let mut bins: Vec<_> = env::var("PATH") let mut bins: Vec<_> = env::var("PATH")
.unwrap_or_default() .unwrap_or_default()
.split(':') .split(PATH_SEPARATOR)
.map(PathBuf::from) .map(PathBuf::from)
.collect(); .collect();
bins.push(cwd); bins.push(cwd);