assertables

Macro assert_command_stderr_eq

source
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:
(command1 ⇒ stderr ⇒ string) = (command2 ⇒ stderr ⇒ string)

  • 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", "hello"]);
let mut b = Command::new("bin/printf-stderr");
b.args(["%s", "hello"]);
assert_command_stderr_eq!(a, b);

let mut a = Command::new("bin/printf-stderr");
a.args(["%s", "hello"]);
let mut b = Command::new("bin/printf-stderr");
b.args(["%s", "zzz"]);
assert_command_stderr_eq!(a, b);
// assertion failed: `assert_command_stderr_eq!(a_command, b_command)`
// https://docs.rs/assertables/8.14.0/assertables/macro.assert_command_stderr_eq.html
//  a label: `a`,
//  a debug: `\"bin/printf-stderr\" \"%s\" \"hello\"`,
//  b label: `b`,
//  b debug: `\"bin/printf-stderr\" \"%s\" \"zzz\"`,
//        a: `\"hello\"`,
//        b: `\"zzz\"`

§Module macros