macro_rules! assert_status_code_value_le_x {
($a_process:expr, $b:expr $(,)?) => { ... };
($a_process:expr, $b:expr, $($message:tt)+) => { ... };
}Expand description
Assert a status code value is less than or equal to an expression.
Pseudocode:
a.len() ≤ b
-
If true, return `a ⇒ status ⇒ code ⇒ value``.
-
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/exit-with-arg"); a.arg("1");
let b = 2;
assert_status_code_value_le_x!(a, b);
// This will panic
let mut a = Command::new("bin/exit-with-arg"); a.arg("2");
let b = 1;
assert_status_code_value_le_x!(a, b);
// assertion failed: `assert_status_code_value_le_x!(a, b)`
// https://docs.rs/assertables/…/assertables/macro.assert_status_code_value_le_x.html
// a label: `a`,
// a debug: `\"bin/exit-with-arg\" \"1\"`,
// a value: `2`",
// b label: `b`,
// b debug: `1`