Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A test macro similar to futures-test::test could be nice #3713

Open
ValouBambou opened this issue Jan 3, 2025 · 0 comments
Open

A test macro similar to futures-test::test could be nice #3713

ValouBambou opened this issue Jan 3, 2025 · 0 comments

Comments

@ValouBambou
Copy link
Contributor

ValouBambou commented Jan 3, 2025

In order to reduce verbosity in some tests that I wrote for a library relying on embassy-time I would like to write something similar to the futures-test::test macro enable which would look like this :

#[embassy_executor::test]
async fn my_test() {
    let fut = async { true };
    assert!(fut.await);
}

Which would expand in something equivalent to the code that I would write manually :

#[test]
fn my_test() {
    embassy_futures::block_on(async move {
        let fut = async { true };
        assert!(fut.await);
    })
}

Do you think this is a nice feature to have ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant