#async-test #async #setting-up #futures-lite #test

macro no-std lite-async-test

An #![async_test] wrapper using futures-lite, for easily setting up async tests in your crates/binaries

4 releases

0.1.3 Jan 23, 2024
0.1.2 Oct 9, 2023
0.1.1 Oct 8, 2023
0.1.0 Oct 8, 2023

#20 in #async-test


Used in is31fl3733

Custom license

4KB

lite-async-test

An #![async_test] wrapper using futures-lite, for easily setting up async tests in your crates/binaries.

This is implemented using a very simple procedural macro which wraps the original test with an synchronous version which uses futures-lite to execute.

This crate is suitable for usage in no_std targets.

To use, simply include

#[cfg(test)]
mod tests {
    use super::*;
    use lite_async_test::async_test;

    #[async_test]
    async fn some_test() {
        assert_eq!(value, get_value().await);
    }
}

Disclaimer: This library is not an official product, use freely at your own risk.

Dependencies

~0.5–1MB
~20K SLoC