Skip to content

Commit f50e2d2

Browse files
committed
Fix futures-channel tests
1 parent 7117b21 commit f50e2d2

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

futures-channel/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ default = ["std"]
1818
futures-core = { path = "../futures-core", version = "0.2", default-features = false }
1919

2020
[dev-dependencies]
21-
futures = { path = "../futures", version = "0.2", default-features = false }
22-
futures-executor = { path = "../futures-executor", version = "0.2", default-features = false }
21+
futures = { path = "../futures", version = "0.2", default-features = true }
22+
futures-executor = { path = "../futures-executor", version = "0.2", default-features = true }

futures-channel/tests/mpsc.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,22 @@ fn send_recv_no_buffer() {
3232

3333
// Run on a task context
3434
let f = poll_fn(move |cx| {
35-
assert!(tx.flush(cx).unwrap().is_ready());
35+
assert!(tx.poll_flush(cx).unwrap().is_ready());
3636
assert!(tx.poll_ready(cx).unwrap().is_ready());
3737

3838
// Send first message
39-
let res = tx.start_send(cx, 1).unwrap();
40-
assert!(res.is_ok());
39+
assert!(tx.start_send(1).is_ok());
4140
assert!(tx.poll_ready(cx).unwrap().is_not_ready());
4241

4342
// Send second message
44-
let res = tx.start_send(cx, 2).unwrap();
45-
assert!(res.is_err());
43+
assert!(tx.poll_ready(cx).unwrap().is_not_ready());
4644

4745
// Take the value
4846
assert_eq!(rx.poll(cx).unwrap(), Async::Ready(Some(1)));
4947
assert!(tx.poll_ready(cx).unwrap().is_ready());
5048

51-
let res = tx.start_send(cx, 2).unwrap();
52-
assert!(res.is_ok());
49+
assert!(tx.poll_ready(cx).unwrap().is_ready());
50+
assert!(tx.start_send(2).is_ok());
5351
assert!(tx.poll_ready(cx).unwrap().is_not_ready());
5452

5553
// Take the value
@@ -430,7 +428,7 @@ fn stress_poll_ready() {
430428
// (asserting that it doesn't attempt to block).
431429
while self.count > 0 {
432430
try_ready!(self.sender.poll_ready(cx).map_err(|_| ()));
433-
assert!(self.sender.start_send(cx, self.count).unwrap().is_ok());
431+
assert!(self.sender.start_send(self.count).is_ok());
434432
self.count -= 1;
435433
}
436434
Ok(Async::Ready(()))
@@ -502,7 +500,7 @@ fn try_send_2() {
502500

503501
let th = thread::spawn(|| {
504502
block_on(poll_fn(|cx| {
505-
assert!(tx.start_send(cx, "fail").unwrap().is_err());
503+
assert!(tx.poll_ready(cx).unwrap().is_not_ready());
506504
Ok::<_, ()>(Async::Ready(()))
507505
})).unwrap();
508506

0 commit comments

Comments
 (0)