refactor: adjust tests for unused variables and simplified command args

This commit is contained in:
Andrew Phillips
2025-05-12 12:06:35 -03:00
committed by Andrew Phillips (aider)
parent 68167e9d05
commit 543468bf0e

View File

@@ -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::<i64>().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");