aboutsummaryrefslogtreecommitdiff
path: root/tests/inspect.rs
blob: 4cbe4779aa8bb5a4df686c72fb84f73d88a9fad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[cfg(feature = "executor")]
#[test]
fn smoke() {
    use futures::executor::block_on;
    use futures::future::{self, FutureExt};

    let mut counter = 0;

    {
        let work = future::ready::<i32>(40).inspect(|val| { counter += *val; });
        assert_eq!(block_on(work), 40);
    }

    assert_eq!(counter, 40);
}