fune/third_party/rust/tokio-stream/tests/stream_iter.rs
Mike Hommey 46156fb100 Bug 1710421 - [webdriver] Update warp and hyper dependencies. r=mjf,webdriver-reviewers
At the same time, update mdns_service to socket2 0.4 to avoid a duplicate.

Differential Revision: https://phabricator.services.mozilla.com/D147479
2022-06-01 22:05:53 +00:00

18 lines
344 B
Rust

use tokio_stream as stream;
use tokio_test::task;
use std::iter;
#[tokio::test]
async fn coop() {
let mut stream = task::spawn(stream::iter(iter::repeat(1)));
for _ in 0..10_000 {
if stream.poll_next().is_pending() {
assert!(stream.is_woken());
return;
}
}
panic!("did not yield");
}