1 #![cfg(all(feature = "full", tokio_unstable))] 2 3 use tokio::task; 4 use tokio_test::task::spawn; 5 6 // `yield_now` is tested within the runtime in `rt_common`. 7 #[test] yield_now_outside_of_runtime()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