assertables

Macro assert_program_args_stdout_ge_expr

source
macro_rules! assert_program_args_stdout_ge_expr {
    ($a_program:expr, $a_args:expr, $b_expr:expr $(,)?) => { ... };
    ($a_program:expr, $a_args:expr, $b_expr:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a command (built with program and args) stdout string is greater than or equal to an expression.

Pseudocode:
(program1 + args1 ⇒ command ⇒ stdout ⇒ string) ≥ (expr into string)

  • If true, return ().

  • Otherwise, call panic! with a message and the values of the expressions with their debug representations.

§Examples


let program = "bin/printf-stdout";
let args = ["%s", "hello"];
let s = String::from("hello");
assert_program_args_stdout_ge_expr!(&program, &args, s);

let program = "bin/printf-stdout";
let args = ["%s", "hello"];
let s = String::from("zzz");
assert_program_args_stdout_ge_expr!(&program, &args, s);
// assertion failed: `assert_program_args_stdout_ge_expr!(a_program, a_args, b_expr)`
// https://docs.rs/assertables/8.9.0/assertables/macro.assert_program_args_stdout_ge_expr.html
//  a_program label: `&program`,
//  a_program debug: `\"bin/printf-stdout\"`,
//     a_args label: `&args`,
//     a_args debug: `[\"%s\", \"hello\"]`,
//     b_expr label: `s`,
//     b_expr debug: `\"zzz\"`,
//                a: `\"hello\"`,
//                b: `\"zzz\"`

§Module macros