1 #![warn(rust_2018_idioms)]
2 #![cfg(all(feature = "full", not(miri)))]
3 
4 use tokio::io::AsyncReadExt;
5 
6 #[tokio::test]
repeat_poll_read_is_cooperative()7 async fn repeat_poll_read_is_cooperative() {
8     tokio::select! {
9         biased;
10         _ = async {
11             loop {
12                 let mut buf = [0u8; 4096];
13                 tokio::io::repeat(0b101).read_exact(&mut buf).await.unwrap();
14             }
15         } => {},
16         _ = tokio::task::yield_now() => {}
17     }
18 }
19