refactor: remove closure from create_test_items in test_save_item

This commit is contained in:
Andrew Phillips
2025-05-12 13:31:34 -03:00
committed by Andrew Phillips (aider)
parent 7490be8e42
commit c34d7ccf4d

View File

@@ -74,20 +74,19 @@ mod tests {
fn test_save_item() {
with_temp_env(|data_dir| {
// Create test items with the common environment setup
create_test_items(data_dir, |input, tag| {
// Set the data directory for this test
let env = format!("KEEP_DIR={} cargo run --", data_dir.display());
create_test_items(data_dir);
// Set the data directory for this test
let env = format!("KEEP_DIR={} cargo run --", data_dir.display());
// Create a command that pipes input to keep with the specified environment
let cmd = format!("echo {} | {} {}", input, env, tag);
let output = run_sh(cmd.as_str());
assert!(
output.status.success(),
"Command failed: {} RC={}",
cmd,
output.status
// Create a command that pipes input to keep with the specified environment
let cmd = format!("echo {} | {} {}", input, env, tag);
let output = run_sh(cmd.as_str());
assert!(
output.status.success(),
"Command failed: {} RC={}",
cmd,
output.status
);
});
});
}