summaryrefslogtreecommitdiffstats
path: root/third_party/rust/tokio-stream/tests/stream_once.rs
blob: f32bad3a1208514a9e3beebf3433754e00da9f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use tokio_stream::{self as stream, Stream, StreamExt};

#[tokio::test]
async fn basic_usage() {
    let mut one = stream::once(1);

    assert_eq!(one.size_hint(), (1, Some(1)));
    assert_eq!(Some(1), one.next().await);

    assert_eq!(one.size_hint(), (0, Some(0)));
    assert_eq!(None, one.next().await);
}