1#![cfg(all(feature = "full", tokio_unstable))]
2
3use tokio::task;
4use tokio_test::task::spawn;
5
6// `yield_now` is tested within the runtime in `rt_common`.
7#[test]
8fn yield_now_outside_of_runtime() {
9 let mut task = spawn(async {
10 task::yield_now().await;
11 });
12
13 assert!(task.poll().is_pending());
14 assert!(task.is_woken());
15 assert!(task.poll().is_ready());
16}
17