assert_status_failure

Macro assert_status_failure 

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

Assert a status is a failure.

Pseudocode:
a ⇒ status ⇒ success = false

  • 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");
assert_status_failure!(a);

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

§Module macros