#[cfg(test)]
mod tests {
use destructive_command_guard::config::Config;
use destructive_command_guard::evaluator::evaluate_command;
use destructive_command_guard::load_default_allowlists;
#[test]
fn test_rm_multi_arg_vulnerability() {
let config = Config::default();
let compiled_overrides = config.overrides.compile();
let allowlists = load_default_allowlists();
let cmd = "rm -rf /tmp/safe /etc/passwd";
let result = evaluate_command(
cmd,
&config,
&["rm"], &compiled_overrides,
&allowlists,
);
assert!(
result.is_denied(),
"Command '{cmd}' should be denied but was allowed!"
);
}
}