()
| 239 | |
| 240 | #[test] |
| 241 | fn schedule() { |
| 242 | let (s, r) = channel::unbounded(); |
| 243 | let schedule = move |t| s.send(t).unwrap(); |
| 244 | let (task, _handle) = async_task::spawn( |
| 245 | future::poll_fn(|_| Poll::<()>::Pending), |
| 246 | schedule, |
| 247 | Box::new(0), |
| 248 | ); |
| 249 | |
| 250 | assert!(r.is_empty()); |
| 251 | task.schedule(); |
| 252 | |
| 253 | let task = r.recv().unwrap(); |
| 254 | assert!(r.is_empty()); |
| 255 | task.schedule(); |
| 256 | |
| 257 | let task = r.recv().unwrap(); |
| 258 | assert!(r.is_empty()); |
| 259 | task.schedule(); |
| 260 | |
| 261 | r.recv().unwrap(); |
| 262 | } |
| 263 | |
| 264 | #[test] |
| 265 | fn tag() { |
no test coverage detected