sf_assert_ok

Macro sf_assert_ok 

Source
macro_rules! sf_assert_ok {
    ($cond:expr $(,)?) => { ... };
    ($cond:expr, $($arg:tt)+) => { ... };
}
Expand description

Passes if the argument is an Ok result.

Passes if the argument is an instance of Result::Ok(T). Otherwise, the test is marked as failure.

ยงExamples

sf_assert_ok!(my_function_ok());
let empty = Result::Ok();
sf_assert_ok!(empty);
let err = Result::Err();
sf_assert_ok!(err, "this test is a failure");