Debian Codegraph @

third_party/rust/tokio-stream/tests/stream_pending.rs

raw
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 }