summaryrefslogtreecommitdiffstats
path: root/vendor/futures/tests/future_fuse.rs
blob: 83f2c1ce9e1944b76749a51143a8b9dab2e5d40c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use futures::future::{self, FutureExt};
use futures::task::Context;
use futures_test::task::panic_waker;

#[test]
fn fuse() {
    let mut future = future::ready::<i32>(2).fuse();
    let waker = panic_waker();
    let mut cx = Context::from_waker(&waker);
    assert!(future.poll_unpin(&mut cx).is_ready());
    assert!(future.poll_unpin(&mut cx).is_pending());
}