1 | use tokio_stream::{self as stream, Stream, StreamExt}; |
---|---|
2 | use tokio_test::{assert_pending, task}; |
3 | |
4 | #[tokio::test] |
5 | async fn basic_usage() { |
6 | let mut stream = stream::pending::<i32>(); |
7 | |
8 | for _ in 0..2 { |
9 | assert_eq!(stream.size_hint(), (0, None)); |
10 | |
11 | let mut next = task::spawn(async { stream.next().await }); |
12 | assert_pending!(next.poll()); |
13 | } |
14 | } |
15 |