rusty-fork icon indicating copy to clipboard operation
rusty-fork copied to clipboard

Support for async tests

Open hberntsen opened this issue 5 years ago • 1 comments

The rusty_fork_test! macro does not accept async fn. I need to test some async functions that share global data structures. It would be very useful that this could be done via rusty-fork :).

hberntsen avatar May 15 '20 08:05 hberntsen

I wouldn't be surprised if there were some tricky corner cases with this. For now the obvious workaround works:

let rt  = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
    [...]
})

mrcnski avatar Oct 30 '23 11:10 mrcnski