test: add detailed error messages to assert statements
This commit is contained in:
@@ -151,7 +151,8 @@ mod tests {
|
|||||||
cmd,
|
cmd,
|
||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
assert!(String::from_utf8_lossy(&output.stdout).contains("test content A"));
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
|
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
||||||
|
|
||||||
let cmd = format!("{} --get tag_b", env);
|
let cmd = format!("{} --get tag_b", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -280,8 +281,10 @@ mod tests {
|
|||||||
cmd,
|
cmd,
|
||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
assert!(String::from_utf8_lossy(&output.stdout).contains("test content A"));
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(String::from_utf8_lossy(&output.stdout).contains("test content B"));
|
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
||||||
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
|
assert!(output_str.contains("test content B"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content B\"", cmd, output_str);
|
||||||
|
|
||||||
let cmd = format!("{} --diff tag_a tag_b", env);
|
let cmd = format!("{} --diff tag_a tag_b", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user