From c34d7ccf4dd193b1943e0062af77f898acfdfcf2 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 12 May 2025 13:31:34 -0300 Subject: [PATCH] refactor: remove closure from create_test_items in test_save_item --- src/tests.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/tests.rs b/src/tests.rs index 2b774b8..6727f05 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -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 ); - }); }); }