[go: up one dir, main page]

async-executor 1.9.0

Async executor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use async_executor::Executor;
use futures_lite::{future, prelude::*};

#[test]
fn test_panic_propagation() {
    let ex = Executor::new();
    let task = ex.spawn(async { panic!("should be caught by the task") });

    // Running the executor should not panic.
    assert!(ex.try_tick());

    // Polling the task should.
    assert!(future::block_on(task.catch_unwind()).is_err());
}