mirror of
https://github.com/logos-blockchain/logos-blockchain-simulations.git
synced 2026-01-07 15:43:09 +00:00
fix tests
This commit is contained in:
parent
abed699d1a
commit
8536b078aa
@ -67,6 +67,7 @@ mod tests {
|
||||
let (update_sender, update_receiver) = channel::unbounded();
|
||||
let mut interval = CounterInterval::new(Duration::from_secs(1), update_receiver);
|
||||
|
||||
update_sender.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(interval.poll_next_unpin(&mut cx), Poll::Ready(Some(0)));
|
||||
update_sender.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(interval.poll_next_unpin(&mut cx), Poll::Pending);
|
||||
@ -88,6 +89,7 @@ mod tests {
|
||||
let (update_sender, update_receiver) = channel::unbounded();
|
||||
let mut slot = Slot::new(3, Duration::from_secs(1), update_receiver);
|
||||
|
||||
update_sender.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(slot.poll_next_unpin(&mut cx), Poll::Ready(Some(0)));
|
||||
update_sender.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(slot.poll_next_unpin(&mut cx), Poll::Pending);
|
||||
|
||||
@ -118,6 +118,7 @@ mod tests {
|
||||
let (tx, rx) = channel::unbounded();
|
||||
let mut interval = Interval::new(Duration::from_secs(2), rx);
|
||||
|
||||
tx.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(interval.poll_next_unpin(&mut cx), Poll::Ready(Some(())));
|
||||
tx.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(interval.poll_next_unpin(&mut cx), Poll::Pending);
|
||||
@ -133,7 +134,7 @@ mod tests {
|
||||
fn temporal_release_update() {
|
||||
let (_tx, rx) = channel::unbounded();
|
||||
let mut temporal_release =
|
||||
TemporalRelease::new(rand_chacha::ChaCha8Rng::from_entropy(), rx, (1, 2));
|
||||
TemporalRelease::new(rand_chacha::ChaCha8Rng::from_entropy(), rx, (1, 1));
|
||||
|
||||
assert!(!temporal_release.update(Duration::from_secs(0)));
|
||||
assert!(!temporal_release.update(Duration::from_millis(999)));
|
||||
@ -148,12 +149,8 @@ mod tests {
|
||||
|
||||
let (tx, rx) = channel::unbounded();
|
||||
let mut temporal_release =
|
||||
TemporalRelease::new(rand_chacha::ChaCha8Rng::from_entropy(), rx, (1, 2));
|
||||
TemporalRelease::new(rand_chacha::ChaCha8Rng::from_entropy(), rx, (1, 1));
|
||||
|
||||
assert_eq!(
|
||||
temporal_release.poll_next_unpin(&mut cx),
|
||||
Poll::Ready(Some(()))
|
||||
);
|
||||
tx.send(Duration::from_secs(0)).unwrap();
|
||||
assert_eq!(temporal_release.poll_next_unpin(&mut cx), Poll::Pending);
|
||||
tx.send(Duration::from_millis(999)).unwrap();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user