mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
chore: move enumerate test to correct location (#867)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
extern crate futures;
|
||||
extern crate tokio;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
|
||||
use futures::sync::mpsc;
|
||||
use tokio::util::StreamExt;
|
||||
|
||||
#[test]
|
||||
fn enumerate() {
|
||||
use futures::*;
|
||||
|
||||
let (mut tx, rx) = mpsc::channel(1);
|
||||
|
||||
std::thread::spawn(|| {
|
||||
for i in 0..5 {
|
||||
tx = tx.send(i * 2).wait().unwrap();
|
||||
}
|
||||
});
|
||||
|
||||
let result = rx.enumerate().collect();
|
||||
assert_eq!(
|
||||
result.wait(),
|
||||
Ok(vec![(0, 0), (1, 2), (2, 4), (3, 6), (4, 8)])
|
||||
);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user