macro_rules! assert_command_stderr_eq {
($a_command:expr, $b_command:expr $(,)?) => { ... };
($a_command:expr, $b_command:expr, $($message:tt)+) => { ... };
}Expand description
Assert a command stderr string is equal to another.
Pseudocode:
(a_command ⇒ stderr) = (b_command ⇒ stderr)
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
use std::process::Command;
let mut a = Command::new("bin/printf-stderr");
a.args(["%s", "alfa"]);
let mut b = Command::new("bin/printf-stderr");
b.args(["%s", "alfa"]);
assert_command_stderr_eq!(a, b);
// This will panic
let mut a = Command::new("bin/printf-stderr");
a.args(["%s", "alfa"]);
let mut b = Command::new("bin/printf-stderr");
b.args(["%s", "zz"]);
assert_command_stderr_eq!(a, b);
// assertion failed: `assert_command_stderr_eq!(a_command, b_command)`
// https://docs.rs/assertables/…/assertables/macro.assert_command_stderr_eq.html
// a label: `a`,
// a debug: `\"bin/printf-stderr\" \"%s\" \"alfa\"`,
// a value: `[97, 108, 102, 97]`,
// b label: `b`,
// b debug: `\"bin/printf-stderr\" \"%s\" \"zz\"`,
// b value: `[122, 122]`