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_b = "test content B";
// Create first item with tag_a
f(input_a, "tag_a");
// Create second item with tag_b
f(input_b, "tag_b");
// Create first item with tag_a and tag
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 and tag
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