test: use env to run commands and add 'tag' as tag
This commit is contained in:
14
src/tests.rs
14
src/tests.rs
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user