assert_status_code_value_gt_x

Macro assert_status_code_value_gt_x 

Source
macro_rules! assert_status_code_value_gt_x {
    ($a_process:expr, $b:expr $(,)?) => { ... };
    ($a_process:expr, $b:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a status code value is greater than 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("2");
let b = 1;
assert_status_code_value_gt_x!(a, b);

// This will panic
let mut a = Command::new("bin/exit-with-arg"); a.arg("1");
let b = 2;
assert_status_code_value_gt_x!(a, b);
// assertion failed: `assert_status_code_value_gt_x!(a, b)`
// https://docs.rs/assertables/…/assertables/macro.assert_status_code_value_gt_x.html
//  a label: `a`,
//  a debug: `\"bin/exit-with-arg\" \"1\"`,
//  a value: `1`",
//  b label: `b`,
//  b debug: `2`

§Module macros