1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-30 00:14:58 +02:00

cleanup top level doc comments

This commit is contained in:
Rob Ede
2021-01-15 05:38:50 +00:00
parent b2a9ba2ee4
commit 0a506bf2e9
17 changed files with 57 additions and 82 deletions

View File

@ -800,6 +800,7 @@ async fn test_reading_deflate_encoding_large_random_rustls() {
assert_eq!(bytes, Bytes::from(data));
}
// TODO: why is test ignored
// #[test]
// fn test_server_cookies() {
// use actix_web::http;
@ -889,28 +890,3 @@ async fn test_normalize() {
let response = srv.get("/one/").send().await.unwrap();
assert!(response.status().is_success());
}
// #[cfg(feature = "openssl")]
// #[actix_rt::test]
// async fn test_ssl_handshake_timeout() {
// use open_ssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
// use std::net;
// // load ssl keys
// let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
// builder
// .set_private_key_file("tests/key.pem", SslFiletype::PEM)
// .unwrap();
// builder
// .set_certificate_chain_file("tests/cert.pem")
// .unwrap();
// let srv = test::start_with(test::config().openssl(builder.build()), || {
// App::new().service(web::resource("/").route(web::to(|| HttpResponse::Ok())))
// });
// let mut stream = net::TcpStream::connect(srv.addr()).unwrap();
// let mut data = String::new();
// let _ = stream.read_to_string(&mut data);
// assert!(data.is_empty());
// }

View File

@ -1,30 +1,30 @@
// Regression test for #/1321
//! Regression test for https://github.com/actix/actix-web/issues/1321
/*
use futures::task::{noop_waker, Context};
use futures::stream::once;
use actix_http::body::{MessageBody, BodyStream};
use bytes::Bytes;
// use actix_http::body::{BodyStream, MessageBody};
// use bytes::Bytes;
// use futures_channel::oneshot;
// use futures_util::{
// stream::once,
// task::{noop_waker, Context},
// };
Disable weird poll until actix-web is based on actix-http 2.0.0
// #[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())
// })));
#[test]
fn weird_poll() {
let (sender, receiver) = futures::channel::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())
})));
// let waker = noop_waker();
// let mut cx = Context::from_waker(&waker);
let waker = noop_waker();
let mut context = Context::from_waker(&waker);
let _ = body_stream.as_mut().unwrap().poll_next(&mut context);
sender.send(()).unwrap();
let _ = std::mem::replace(&mut body_stream, Err([0; 32])).unwrap().poll_next(&mut context);
}
*/
// 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);
// }