mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
More tests (#285)
This commit is contained in:
parent
5a04548e13
commit
e8c175a17f
9 changed files with 84 additions and 18 deletions
|
@ -117,6 +117,8 @@ mod tests {
|
|||
Poll::Pending
|
||||
);
|
||||
cond.notify();
|
||||
assert!(format!("{:?}", cond).contains("Condition"));
|
||||
assert!(format!("{:?}", waiter).contains("Waiter"));
|
||||
assert_eq!(waiter.await, ());
|
||||
|
||||
let mut waiter = cond.wait();
|
||||
|
@ -145,10 +147,14 @@ mod tests {
|
|||
|
||||
let waiter2 = waiter.clone();
|
||||
assert_eq!(lazy(|cx| waiter.poll_ready(cx)).await, Poll::Pending);
|
||||
assert_eq!(lazy(|cx| waiter.poll_ready(cx)).await, Poll::Pending);
|
||||
assert_eq!(lazy(|cx| waiter2.poll_ready(cx)).await, Poll::Pending);
|
||||
assert_eq!(lazy(|cx| waiter2.poll_ready(cx)).await, Poll::Pending);
|
||||
|
||||
drop(cond);
|
||||
assert_eq!(lazy(|cx| waiter.poll_ready(cx)).await, Poll::Ready(()));
|
||||
assert_eq!(lazy(|cx| waiter.poll_ready(cx)).await, Poll::Pending);
|
||||
assert_eq!(lazy(|cx| waiter2.poll_ready(cx)).await, Poll::Ready(()));
|
||||
assert_eq!(lazy(|cx| waiter2.poll_ready(cx)).await, Poll::Pending);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue