1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-12-12 15:30:23 +01:00
actix-web/tests/test_weird_poll.rs

31 lines
881 B
Rust
Raw Normal View History

2021-01-15 06:38:50 +01:00
//! Regression test for https://github.com/actix/actix-web/issues/1321
2021-01-15 06:38:50 +01:00
// use actix_http::body::{BodyStream, MessageBody};
// use bytes::Bytes;
// use futures_channel::oneshot;
// use futures_util::{
// stream::once,
// task::{noop_waker, Context},
// };
2021-01-15 06:38:50 +01:00
// #[test]
// fn weird_poll() {
// let (sender, receiver) = oneshot::channel();
// let mut body_stream = Ok(BodyStream::new(once(async {
// let x = Box::new(0);
// let y = &x;
// receiver.await.unwrap();
// let _z = **y;
// Ok::<_, ()>(Bytes::new())
// })));
2021-01-15 06:38:50 +01:00
// let waker = noop_waker();
// let mut cx = Context::from_waker(&waker);
2021-01-15 06:38:50 +01:00
// let _ = body_stream.as_mut().unwrap().poll_next(&mut cx);
// sender.send(()).unwrap();
// let _ = std::mem::replace(&mut body_stream, Err([0; 32]))
// .unwrap()
// .poll_next(&mut cx);
// }