summaryrefslogtreecommitdiffstats
path: root/tokio-executor/tests/enter.rs
blob: fd13bd121335d6a30e77cb8d1727d423e0dcd50b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![warn(rust_2018_idioms)]
#![feature(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);
}