Macro assertables::assert_program_args_stdout_ge

source ·
macro_rules! assert_program_args_stdout_ge {
    ($a_program:expr, $a_args:expr, $b_program:expr, $b_args:expr $(,)?) => { ... };
    ($a_program:expr, $a_args:expr, $b_program:expr, $($message:tt)+) => { ... };
}
Expand description

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

Pseudocode:
(program1 + args1 ⇒ command ⇒ stdout ⇒ string) ≥ (program2 + args2 ⇒ command ⇒ stdout ⇒ string)

  • If true, return ().

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

§Examples


let a_program = "bin/printf-stdout";
let a_args = ["%s", "hello"];
let b_program = "bin/printf-stdout";
let b_args = ["%s%s%s%s%s", "h", "a", "l", "l", "o"];
assert_program_args_stdout_ge!(&a_program, &a_args, &b_program, &b_args);

let a_program = "bin/printf-stdout";
let a_args = ["%s", "hello"];
let b_program = "bin/printf-stdout";
let b_args = ["%s%s%s%s%s", "h", "u", "l", "l", "o"];
assert_program_args_stdout_ge!(&a_program, &a_args, &b_program, &b_args);
// assertion failed: `assert_program_args_stdout_ge!(a_program, a_args, b_program, b_args)`
// https://docs.rs/assertables/8.7.0/assertables/macro.assert_program_args_stdout_ge.html
//  a_program label: `&a_program`,
//  a_program debug: `\"bin/printf-stdout\"`,
//     a_args label: `&a_args`,
//     a_args debug: `[\"%s\", \"hello\"]`,
//  b_program label: `&b_program`,
//  b_program debug: `\"bin/printf-stdout\"`,
//     b_args label: `&b_args`,
//     b_args debug: `[\"%s%s%s%s%s\", \"h\", \"u\", \"l\", \"l\", \"o\"]`,
//                a: `\"hello\"`,
//                b: `\"hullo\"`

§Module macros