Macro assert_command_stdout_ge

Source
macro_rules! assert_command_stdout_ge {
    ($a_command:expr, $b_command:expr $(,)?) => { ... };
    ($a_command:expr, $b_command:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a command stdout string is greater than or equal to another.

Pseudocode:
(a_command ⇒ stdout) = (b_command ⇒ stdout)

  • If true, return (a_stdout, b_stdout).

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

// This will panic
let mut a = Command::new("bin/printf-stdout");
a.args(["%s", "alfa"]);
let mut b = Command::new("bin/printf-stdout");
b.args(["%s", "zz"]);
assert_command_stdout_ge!(a, b);
// assertion failed: `assert_command_stdout_ge!(a_command, b_command)`
// https://docs.rs/assertables/…/assertables/macro.assert_command_stdout_ge.html
//  a label: `a`,
//  a debug: `\"bin/printf-stdout\" \"%s\" \"alfa\"`,
//  b label: `b`,
//  b debug: `\"bin/printf-stdout\" \"%s\" \"zz\"`,
//  a value: `[97, 108, 102, 97]`,
//  b value: `[122, 122]`

§Module macros