Skip to content

Commit d683e13

Browse files
jakubadamwseanmonstar
authored andcommitted
test(client): Re-enable the tests/client.rs test
These tests were temporarily disabled during the migration to the `std::future::Future` type that's part of the stable Rust now. This commit updates the tests after the breaking changes and makes them pass again.
1 parent 0d3cbe2 commit d683e13

File tree

4 files changed

+267
-253
lines changed

4 files changed

+267
-253
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@ pin-utils = "0.1.0-alpha.4"
3838
time = "0.1"
3939
tokio = { git = "https://github.com/tokio-rs/tokio", optional = true, default-features = false, features = ["rt-full"] }
4040
tokio-buf = "0.1"
41+
tokio-current-thread = { git = "https://github.com/tokio-rs/tokio" }
4142
tokio-executor = { git = "https://github.com/tokio-rs/tokio" }
4243
tokio-io = { git = "https://github.com/tokio-rs/tokio" }
4344
tokio-reactor = { git = "https://github.com/tokio-rs/tokio", optional = true }
4445
tokio-sync = { git = "https://github.com/tokio-rs/tokio" }
45-
tokio-tcp = { git = "https://github.com/tokio-rs/tokio", optional = true }
46+
tokio-tcp = { git = "https://github.com/tokio-rs/tokio", optional = true, features = ["async-traits"] }
4647
tokio-threadpool = { git = "https://github.com/tokio-rs/tokio", optional = true }
4748
tokio-timer = { git = "https://github.com/tokio-rs/tokio", optional = true }
4849
want = { git = "https://github.com/seanmonstar/want", branch = "std-future" }
4950

5051
[dev-dependencies]
52+
matches = "0.1"
5153
num_cpus = "1.0"
5254
pretty_env_logger = "0.3"
5355
spmc = "0.2"

src/body/body.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,15 +553,16 @@ mod tests {
553553
// FIXME: re-implement tests with `async/await`, this import should
554554
// trigger a warning to remind us
555555
use crate::Error;
556+
use futures_util::try_stream::TryStreamExt;
557+
use tokio::runtime::current_thread::Runtime;
556558

557-
/*
558559
use super::*;
559560
#[test]
560561
fn test_body_stream_concat() {
561562
let body = Body::from("hello world");
562563

563-
let total = body.concat2().wait().unwrap();
564+
let mut rt = Runtime::new().unwrap();
565+
let total = rt.block_on(body.try_concat()).unwrap();
564566
assert_eq!(total.as_ref(), b"hello world");
565567
}
566-
*/
567568
}

0 commit comments

Comments
 (0)