assert_command_stderr_ge_x

Macro assert_command_stderr_ge_x 

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

Assert a command stderr string is greater than or equal to an expression.

Pseudocode:
(command ⇒ stderr) = (expr into 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 command = Command::new("bin/printf-stderr");
command.args(["%s", "alfa"]);
let bytes = vec![b'a', b'a'];
assert_command_stderr_ge_x!(command, bytes);

// This will panic
let mut command = Command::new("bin/printf-stderr");
command.args(["%s", "alfa"]);
let bytes = vec![b'z', b'z'];
assert_command_stderr_ge_x!(command, bytes);
// assertion failed: `assert_command_stderr_ge_x!(command, expr)`
// https://docs.rs/assertables/…/assertables/macro.assert_command_stderr_ge_x.html
//  command label: `command`,
//  command debug: `\"bin/printf-stderr\" \"%s\" \"alfa\"`,
//  command value: `[97, 108, 102, 97]`,
//     expr label: `bytes`,
//     expr debug: `[122, 122]`,
//     expr value: `[122, 122]`

§Module macros