1 use maybe_async::maybe_async;
2
3 #[maybe_async]
async_fn() -> bool4 async fn async_fn() -> bool {
5 true
6 }
7
8 #[maybe_async::test(
9 feature = "is_sync",
10 async(all(not(feature="is_sync"), feature = "async_std"), async_std::test),
11 async(all(not(feature="is_sync"), feature = "tokio"), tokio::test)
12 )]
test_async_fn()13 async fn test_async_fn() {
14 let res = async_fn().await;
15 assert_eq!(res, true);
16 }
17
18 #[maybe_async::test(feature = "is_sync", async(not(feature = "is_sync"), async_std::test))]
test_async_fn2()19 async fn test_async_fn2() {
20 let res = async_fn().await;
21 assert_eq!(res, true);
22 }
23
24 #[maybe_async::test("feature=\"is_sync\"", async(not(feature = "is_sync"), async_std::test))]
test_async_fn3()25 async fn test_async_fn3() {
26 let res = async_fn().await;
27 assert_eq!(res, true);
28 }
29
30 #[maybe_async::test(feature = "is_sync", async("not(feature = \"is_sync\")", "async_std::test"))]
test_async_fn4()31 async fn test_async_fn4() {
32 let res = async_fn().await;
33 assert_eq!(res, true);
34 }
35
main()36 fn main() {
37
38 }
39