should_err

Macro should_err 

Source
macro_rules! should_err {
    (
    $($target:tt)*
) => { ... };
}
Expand description

Wraps a function that takes nothing and returns something, panicking if the result is not Err. Shortcut for should_match!.

// This macro invocation:
should_err! { ... }
// Is equivalent to:
should_match! { ..., pattern = Err(_), message = "Expected `Err`, but got `Ok`" }