summaryrefslogtreecommitdiffstats
path: root/tokio-executor/tests/enter.rs
blob: 25ef600694f05e5de4b8d2e5846792cbf0a3b595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![warn(rust_2018_idioms)]
#![feature(await_macro, async_await)]

#[test]
fn block_on_ready() {
    let mut enter = tokio_executor::enter().unwrap();
    let val = enter.block_on(async { 123 });

    assert_eq!(val, 123);
}

#[test]
fn block_on_pending() {
    let mut enter = tokio_executor::enter().unwrap();
    let val = enter.block_on(async { 123 });

    assert_eq!(val, 123);
}