summaryrefslogtreecommitdiffstats
path: root/third_party/rust/futures/tests/compat.rs
blob: ac04a95ea87b58c1e99721be5bf3f2de6b983d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(feature = "compat")]
#![cfg(not(miri))] // Miri does not support epoll

use futures::compat::Future01CompatExt;
use futures::prelude::*;
use std::time::Instant;
use tokio::runtime::Runtime;
use tokio::timer::Delay;

#[test]
fn can_use_01_futures_in_a_03_future_running_on_a_01_executor() {
    let f = async { Delay::new(Instant::now()).compat().await };

    let mut runtime = Runtime::new().unwrap();
    runtime.block_on(f.boxed().compat()).unwrap();
}