macro_rules! assert_status_success {
($a:expr $(,)?) => { ... };
($a:expr, $($message:tt)+) => { ... };
}Expand description
Assert a status is a success.
Pseudocode:
a ⇒ status ⇒ success = true
-
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("0");
assert_status_success!(a);
// This will panic
let mut a = Command::new("bin/exit-with-arg"); a.arg("1");
assert_status_success!(a);
// assertion failed: `assert_status_success!(a)`
// https://docs.rs/assertables/…/assertables/macro.assert_status_success.html
// a label: `a`,
// a debug: `\"bin/exit-with-arg\" \"1\"`