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

15 lines
369 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 12:32:19 -08:00
use tokio_test::{assert_pending, task};
#[tokio::test]
async fn basic_usage() {
let mut stream = stream::pending::<i32>();
for _ in 0..2 {
assert_eq!(stream.size_hint(), (0, None));
let mut next = task::spawn(async { stream.next().await });
assert_pending!(next.poll());
}
}