mirror of https://github.com/fafhrd91/actix-web
add test for drop HttpRequestPool
This commit is contained in:
parent
b9932b6880
commit
f45b2254c1
|
@ -551,6 +551,25 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_drop_http_request_pool() {
|
||||
let mut srv = init_service(App::new().service(web::resource("/").to(
|
||||
|req: HttpRequest| {
|
||||
HttpResponse::Ok()
|
||||
.set_header("pool_cap", req.inner.config.pool().cap)
|
||||
.finish()
|
||||
},
|
||||
)))
|
||||
.await;
|
||||
|
||||
let req = TestRequest::default().to_request();
|
||||
let resp = call_service(&mut srv, req).await;
|
||||
|
||||
drop(srv);
|
||||
|
||||
assert_eq!(resp.headers().get("pool_cap").unwrap(), "128");
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_data() {
|
||||
let mut srv = init_service(App::new().app_data(10usize).service(
|
||||
|
|
Loading…
Reference in New Issue