chore: enable full CI run (#1399)

* update all tests
* fix doc examples
* misc API tweaks
This commit is contained in:
Carl Lerche
2019-08-07 20:02:13 -07:00
committed by GitHub
parent 831be9c08e
commit 962521f449
53 changed files with 1231 additions and 2793 deletions
+13 -8
View File
@@ -2,21 +2,26 @@
//!
//! # Example
//!
//! ```ignore
//! use tokio_test::clock;
//! use tokio_test::{assert_ready, assert_not_ready};
//! ```
//! #![feature(async_await)]
//!
//! use tokio::clock;
//! use tokio_test::{assert_ready, assert_pending, task};
//! use tokio_timer::Delay;
//!
//! use std::time::Duration;
//! use futures::Future;
//!
//! clock::mock(|handle| {
//! let mut delay = Delay::new(handle.now() + Duration::from_secs(1));
//! tokio_test::clock::mock(|handle| {
//! let mut task = task::spawn(async {
//! let delay = Delay::new(clock::now() + Duration::from_secs(1));
//! delay.await
//! });
//!
//! assert_not_ready!(delay.poll());
//! assert_pending!(task.poll());
//!
//! handle.advance(Duration::from_secs(1));
//!
//! assert_ready!(delay.poll());
//! assert_ready!(task.poll());
//! });
//! ```
-10
View File
@@ -9,16 +9,6 @@
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
//! Tokio and Futures based testing utilites
//!
//! # Example
//!
//! ```ignore
//! # use futures::{Future, future};
//! use tokio_test::assert_ready;
//!
//! let mut fut = future::ok::<(), ()>(());
//! assert_ready!(fut.poll());
//! ```
pub mod clock;
pub mod io;
-17
View File
@@ -1,21 +1,4 @@
//! Futures task based helpers
//!
//! # Example
//!
//! This example will use the `MockTask` to set the current task on
//! poll.
//!
//! ```ignore
//! # use tokio_test::assert_ready_eq;
//! # use tokio_test::task::MockTask;
//! # use futures::{sync::mpsc, Stream, Sink, Future, Async};
//! let mut task = MockTask::new();
//! let (tx, mut rx) = mpsc::channel(5);
//!
//! tx.send(()).wait();
//!
//! assert_ready_eq!(task.enter(|| rx.poll()), Some(()));
//! ```
use tokio_executor::enter;