mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
Update Tokio to Rust 2018 (#1082)
This commit is contained in:
@@ -7,8 +7,9 @@ name = "tokio-test"
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.1.0"
|
||||
# - Create "v0.2.x" git tag.
|
||||
version = "0.2.0"
|
||||
edition = "2018"
|
||||
authors = ["Tokio Contributors <[email protected]>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/tokio-rs/tokio"
|
||||
@@ -22,5 +23,5 @@ publish = false
|
||||
|
||||
[dependencies]
|
||||
futures = "0.1"
|
||||
tokio-timer = "0.2"
|
||||
tokio-executor = "0.1"
|
||||
tokio-timer = { version = "0.3.0", path = "../tokio-timer" }
|
||||
tokio-executor = { version = "0.2.0", path = "../tokio-executor" }
|
||||
|
||||
@@ -17,7 +17,6 @@ Next, add this to your crate:
|
||||
|
||||
```rust
|
||||
#[macro_use]
|
||||
extern crate tokio_test;
|
||||
```
|
||||
|
||||
You can find extensive documentation and examples about how to use this crate
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
//! # Example
|
||||
//!
|
||||
//! ```
|
||||
//! # #[macro_use] extern crate tokio_test;
|
||||
//! # extern crate futures;
|
||||
//! # extern crate tokio_timer;
|
||||
//! # use tokio_test::clock;
|
||||
//! # use tokio_timer::Delay;
|
||||
//! # use std::time::Duration;
|
||||
//! # use futures::Future;
|
||||
//! use tokio_test::clock;
|
||||
//! use tokio_test::{assert_ready, assert_not_ready};
|
||||
//! 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));
|
||||
//!
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
#![doc(html_root_url = "https://docs.rs/tokio-test/0.1.0")]
|
||||
#![deny(missing_docs, missing_debug_implementations, unreachable_pub)]
|
||||
#![deny(
|
||||
missing_docs,
|
||||
missing_debug_implementations,
|
||||
unreachable_pub,
|
||||
rust_2018_idioms
|
||||
)]
|
||||
#![cfg_attr(test, deny(warnings))]
|
||||
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
|
||||
|
||||
//! Tokio and Futures based testing utilites
|
||||
//!
|
||||
//! # Example
|
||||
//!
|
||||
//! ```
|
||||
//! # extern crate futures;
|
||||
//! # #[macro_use] extern crate tokio_test;
|
||||
//! # use futures::{Future, future};
|
||||
//! use tokio_test::assert_ready;
|
||||
//!
|
||||
//! let mut fut = future::ok::<(), ()>(());
|
||||
//! assert_ready!(fut.poll());
|
||||
//! ```
|
||||
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
|
||||
pub mod clock;
|
||||
mod macros;
|
||||
pub mod task;
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
//! poll.
|
||||
//!
|
||||
//! ```
|
||||
//! # #[macro_use] extern crate tokio_test;
|
||||
//! # extern crate futures;
|
||||
//! # use tokio_test::assert_ready_eq;
|
||||
//! # use tokio_test::task::MockTask;
|
||||
//! # use futures::{sync::mpsc, Stream, Sink, Future, Async};
|
||||
//! let mut task = MockTask::new();
|
||||
@@ -20,7 +19,6 @@
|
||||
|
||||
use futures::executor::{spawn, Notify};
|
||||
use futures::{future, Async};
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Condvar, Mutex};
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#[macro_use]
|
||||
extern crate tokio_test;
|
||||
extern crate futures;
|
||||
extern crate tokio_timer;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
use futures::Future;
|
||||
use std::time::{Duration, Instant};
|
||||
use tokio_test::clock::MockClock;
|
||||
use tokio_test::task::MockTask;
|
||||
use tokio_test::{assert_not_ready, assert_ready};
|
||||
use tokio_timer::Delay;
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user