test: use env to run commands and add 'tag' as tag

This commit is contained in:
Andrew Phillips (aider)
2025-05-12 13:14:26 -03:00
parent d72a71d325
commit 159959173c

View File

@@ -46,11 +46,15 @@ mod tests {
let input_a = "test content A"; let input_a = "test content A";
let input_b = "test content B"; let input_b = "test content B";
// Create first item with tag_a // Create first item with tag_a and tag
f(input_a, "tag_a"); let cmd = format!("echo {} | {} tag tag_a tag", input_a, env);
let output = run_sh(cmd.as_str());
assert!(output.status.success(), "Command failed: {}", input_a);
// Create second item with tag_b // Create second item with tag_b and tag
f(input_b, "tag_b"); let cmd = format!("echo {} | {} tag tag_b tag", input_b, env);
let output = run_sh(cmd.as_str());
assert!(output.status.success(), "Command failed: {}", input_b);
} }
// Helper function to check if a file exists in the data directory // Helper function to check if a file exists in the data directory