lgui-core 0.2.2

Platform-neutral runtime and UI primitives for LGUI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::{
    future::pending,
    task::{Context, Poll, Waker},
};

use super::*;

#[test]
fn cancellation_completes_a_pending_task_without_an_executor_dependency() {
    let (cancel, mut task) = cancellable_task(Box::pin(pending()));
    let waker = Waker::noop();
    let mut context = Context::from_waker(waker);

    assert!(matches!(task.as_mut().poll(&mut context), Poll::Pending));
    cancel.cancel();
    assert!(matches!(task.as_mut().poll(&mut context), Poll::Ready(())));
}