Sha256: 98d78179d21101c365f15f19fc0690651712438b0997c63eb932b94dd6200eae
Contents?: true
Size: 967 Bytes
Versions: 14
Compression:
Stored size: 967 Bytes
Contents
#![warn(rust_2018_idioms)] #![cfg(feature = "full")] use tokio::io::AsyncWriteExt; #[tokio::test] async fn sink_poll_write_is_cooperative() { tokio::select! { biased; _ = async { loop { let buf = vec![1, 2, 3]; tokio::io::sink().write_all(&buf).await.unwrap(); } } => {}, _ = tokio::task::yield_now() => {} } } #[tokio::test] async fn sink_poll_flush_is_cooperative() { tokio::select! { biased; _ = async { loop { tokio::io::sink().flush().await.unwrap(); } } => {}, _ = tokio::task::yield_now() => {} } } #[tokio::test] async fn sink_poll_shutdown_is_cooperative() { tokio::select! { biased; _ = async { loop { tokio::io::sink().shutdown().await.unwrap(); } } => {}, _ = tokio::task::yield_now() => {} } }
Version data entries
14 entries across 14 versions & 1 rubygems