From 543468bf0e22b87f0cd481f83871657e19c7435a Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 12 May 2025 12:06:35 -0300 Subject: [PATCH] refactor: adjust tests for unused variables and simplified command args --- src/tests.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests.rs b/src/tests.rs index 4385d06..3cda72d 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -3,7 +3,7 @@ mod tests { use std::fs; use std::path::Path; use std::process::Command; - use std::process::Stdio; + use tempfile::tempdir; // Helper function to run the keep command with given arguments @@ -22,7 +22,7 @@ mod tests { F: FnOnce(&Path), { let dir = tempdir().expect("Failed to create temporary directory"); - let db_path = dir.path().join("keep-1.db"); + let _db_path = dir.path().join("keep-1.db"); // Create the data directory structure fs::create_dir_all(dir.path()).expect("Failed to create directory"); @@ -165,7 +165,7 @@ mod tests { let id = list_output_str.lines().next().expect("No items found").split_whitespace().next().expect("No ID found").parse::().expect("Invalid ID"); // Delete the item - let output = Command::new("sh") + let _output = Command::new("sh") .arg("-c") .arg(format!("{} cargo run -- --delete {}", env, id)) .output() @@ -235,7 +235,7 @@ mod tests { let mut cmd = Command::new("sh"); cmd.arg("-c") .arg(format!("echo {} | {}", input, env)) - .arg("cargo run -- --save --tag tag1 --tag tag2"); + .arg("cargo run -- --save tag1 tag2"); cmd.spawn() .expect("Failed to spawn process") @@ -245,7 +245,7 @@ mod tests { // List items with a specific tag let output = Command::new("sh") .arg("-c") - .arg(format!("{} cargo run -- --list --tag tag1", env)) + .arg(format!("{} cargo run -- --list tag1", env)) .output() .expect("Failed to execute command");