Files
tokio/tokio-stream/tests/stream_once.rs
T

13 lines
312 B
Rust
Raw Normal View History

2020-12-15 23:24:38 -05:00
use tokio_stream::{self as stream, Stream, StreamExt};
2020-01-11 13:52:51 -08:00
#[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);
}