test: improve error messages with command and status

This commit is contained in:
Andrew Phillips (aider)
2025-05-12 16:02:26 -03:00
parent 978a226b78
commit e72ef13c60

View File

@@ -52,7 +52,7 @@ mod tests {
// Create second item with tag_b and tag // Create second item with tag_b and tag
let cmd = format!("echo {} | {} tag tag_b tag", INPUT_B, env); let cmd = format!("echo {} | {} tag tag_b tag", INPUT_B, env);
let output = run_sh(cmd.as_str()); let output = run_sh(cmd.as_str());
assert!(output.status.success(), "Command failed: {}", INPUT_B); assert!(output.status.success(), "Command failed: {} {}", cmd, output.status);
} }
// Helper function to check if a file exists in the data directory // Helper function to check if a file exists in the data directory
@@ -330,12 +330,12 @@ mod tests {
// Test with no compression // Test with no compression
let cmd = format!("echo {} | {} -c none --tag none", INPUT_A, env); let cmd = format!("echo {} | {} -c none --tag none", INPUT_A, env);
let output = run_sh(cmd.as_str()); let output = run_sh(cmd.as_str());
assert!(output.status.success(), "Command failed: {}", INPUT_A); assert!(output.status.success(), "Command failed: {} {}", cmd, output.status);
// Test with lz4 compression // Test with lz4 compression
let cmd = format!("echo {} | {} -c lz4 --tag lz4", INPUT_A, env); let cmd = format!("echo {} | {} -c lz4 --tag lz4", INPUT_A, env);
let output = run_sh(cmd.as_str()); let output = run_sh(cmd.as_str());
assert!(output.status.success(), "Command failed: {}", INPUT_A); assert!(output.status.success(), "Command failed: {} {}", cmd, output.status);
// Test with gzip compression // Test with gzip compression
let cmd = format!("echo {} | {} -c gzip --tag gzip", INPUT_A, env); let cmd = format!("echo {} | {} -c gzip --tag gzip", INPUT_A, env);