Macro smol_macros::test

source ·
macro_rules! test {
    (
        $(#[$post_attr:meta])*
        async fn $name:ident ($exname:ident : & $exty:ty)
        $(-> $ret:ty)? $bl:block
    ) => { ... };
    (
        $(#[$post_attr:meta])*
        async fn $name:ident ($($pname:ident : $pty:ty),* $(,)?)
        $(-> $ret:ty)? $bl:block
    ) => { ... };
}
Expand description

Wrap a test in an asynchronous executor.

This is equivalent to the main macro, but adds the #[test] attribute.

§Examples

use macro_rules_attribute::apply;
use smol_macros::test;

#[apply(test!)]
async fn do_test() {
    assert_eq!(1 + 1, 2);
}