Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 3f68580

Browse files
Update tests
1 parent b5b10ca commit 3f68580

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/source_futures.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,14 @@ pub fn unix_signal_stream_with_priority(
373373
#[cfg(test)]
374374
mod tests {
375375
use super::*;
376+
use std::time::Duration;
376377
use std::thread;
377378

378379
#[test]
379380
fn test_timeout() {
380381
let c = MainContext::new();
381382

382-
c.block_on(timeout_future(20));
383+
c.block_on(timeout_future(Duration::from_millis(20)));
383384
}
384385

385386
#[test]
@@ -388,7 +389,7 @@ mod tests {
388389
let l = ::MainLoop::new(Some(&c), false);
389390

390391
let l_clone = l.clone();
391-
c.spawn(timeout_future(20).then(move |()| {
392+
c.spawn(timeout_future(Duration::from_millis(20)).then(move |()| {
392393
l_clone.quit();
393394
futures_util::future::ready(())
394395
}));
@@ -405,7 +406,7 @@ mod tests {
405406
{
406407
let count = &mut count;
407408
c.block_on(
408-
interval_stream(20)
409+
interval_stream(Duration::from_millis(20))
409410
.take(2)
410411
.for_each(|()| {
411412
*count += 1;
@@ -423,7 +424,7 @@ mod tests {
423424
fn test_timeout_and_channel() {
424425
let c = MainContext::default();
425426

426-
let res = c.block_on(timeout_future(20).then(|()| {
427+
let res = c.block_on(timeout_future(Duration::from_millis(20)).then(|()| {
427428
let (sender, receiver) = oneshot::channel();
428429

429430
thread::spawn(move || {

0 commit comments

Comments
 (0)