Crates.io | futures-mockstream |
lib.rs | futures-mockstream |
version | 0.1.2 |
source | src |
created_at | 2020-05-06 09:28:42.091115 |
updated_at | 2020-05-06 09:48:35.062093 |
description | Minimal mockstream which implements futures async traits |
homepage | https://github.com/alex179ohm/futures-mockstream |
repository | https://github.com/alex179ohm/futures-mockstream |
max_upload_size | |
id | 238123 |
size | 11,900 |
Install from crates.io
[dependencies]
futures-mockstream = "0.1"
with smol
use futures-mockStream::MockStream;
use smol;
#[cfg(test)]
mod tests {
#[test]
fn async_read() {
smol::run(async {
let mut mockstream = MockStream::from(&b"GET /index HTTP/1.1\r\n");
while let Some(resp) = MyConn::with_stream(mockstream).next().await {
match resp {
Ok(r) => { // your asserts },
Err(e) => {},
}
}
})
}
}