should_error 0.1.1

The test should fail with Err.
Documentation
#![doc = include_str!("../README.md")]

/// Wraps a function that takes nothing and returns a `Result`, panicking if the result is `Ok`.
///
/// See the [crate-level documentation](crate) for more information.
#[macro_export]
macro_rules! should_error {
(
    $(#[$attr:meta])*
    $vis:vis fn $name:ident() -> $ret_ty:ty $body:block
) => {
    $(#[$attr])*
    $vis fn $name() {
        fn inner() -> $ret_ty $body
        let result = inner();
        let is_match = ::core::matches!(result, ::core::result::Result::Err(_));
        assert!(is_match, "Expected `Err`, but got `Ok`");
    }
};
(
    $(#[$attr:meta])*
    $vis:vis fn $name:ident() -> $ret_ty:ty $body:block,
    expected = $expected:pat
) => {
    $(#[$attr])*
    $vis fn $name() {
        fn inner() -> $ret_ty $body
        let result = inner();
        let is_match = ::core::matches!(result, $expected);
        assert!(is_match, "Expected `{}`, but got something else", stringify!($expected));
    }
};
(
    $(#[$attr:meta])*
    $vis:vis fn $name:ident($($arg:ident: $arg_ty:ty,)+) -> $ret_ty:ty $body:block
    $(, expected = $expected:pat)?
) => {
    compile_error!("This macro only supports functions that take no arguments");
}
}