use super::*;
fn expect_wrapped(cmd: &str, binary: &str) -> String {
if cfg!(windows) {
let escaped = cmd.replace('"', "\\\"");
format!("{binary} -c \"{escaped}\"")
} else {
let shell_escaped = cmd.replace('\'', "'\\''");
format!("{binary} -c '{shell_escaped}'")
}
}
fn with_test_allowlist<T>(body: impl FnOnce() -> T) -> T {
let _lock = crate::core::data_dir::test_env_lock();
crate::test_env::set_var(
"LEAN_CTX_SHELL_ALLOWLIST_OVERRIDE",
"git,cargo,npm,head,grep,wc,cat,rg,echo,cd,ls",
);
let out = body();
crate::test_env::remove_var("LEAN_CTX_SHELL_ALLOWLIST_OVERRIDE");
out
}
#[cfg(test)]
#[path = "tests_rewrite_extras.rs"]
mod rewrite_extras;
#[cfg(test)]
#[path = "tests_command_rewrites.rs"]
mod tests_command_rewrites;
#[cfg(test)]
#[path = "tests_file_rewrites.rs"]
mod tests_file_rewrites;
#[cfg(test)]
#[path = "tests_parsing_platform.rs"]
mod tests_parsing_platform;
#[cfg(test)]
#[path = "tests_redirects.rs"]
mod tests_redirects;
#[cfg(test)]
#[path = "tests_search_rewrites.rs"]
mod tests_search_rewrites;