macro_rules! should_ok {
(
$($target:tt)*
) => { ... };
}Expand description
Wraps a function that takes nothing and returns something, panicking if the result is not Ok. Shortcut for should_match!.
ⓘ
// This macro invocation:
should_ok! { ... }
// Is equivalent to:
should_match! { ..., pattern = Ok(_), message = "Expected `Ok`, but got `Err`" }You probably don’t need this, since this is supported by #[test] directly. It exists solely for consistency.