macro_rules! assert_command_stderr_eq_expr { ($a_command:expr, $b_expr:expr $(,)?) => { ... }; ($a_command:expr, $b_expr:expr, $($message:tt)+) => { ... }; }
Expand description
Assert a command stderr string is equal to an expression.
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use std::process::Command;
let mut command = Command::new("bin/printf-stderr");
command.args(["%s", "hello"]);
let s = String::from("hello");
assert_command_stderr_eq_expr!(command, s);
let mut command = Command::new("bin/printf-stderr");
command.args(["%s", "hello"]);
let s = String::from("zzz");
assert_command_stderr_eq_expr!(command, s);
// assertion failed: `assert_command_stderr_eq_expr!(command, expr)`
// command label: `command`,
// expr label: `s`,
// command debug: `\"bin/printf-stderr\" \"%s\" \"hello\"`,
// expr debug: `\"zzz\"`,
// command value: `\"hello\"`,
// expr value: `\"zzz\"`