1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 18:02:58 +01:00

update tests

This commit is contained in:
Nikolay Kim 2019-02-03 11:48:11 -08:00
parent 663ae53954
commit bcc466f6ab

View File

@ -242,10 +242,9 @@ mod tests {
#[test] #[test]
fn test_apply() { fn test_apply() {
let mut srv = Apply::new_fn( let mut srv = Apply::new_fn(Srv, |req: &'static str, srv| {
|req: &'static str, srv| srv.call(()).map(move |res| (req, res)), srv.call(()).map(move |res| (req, res))
Srv, });
);
assert!(srv.poll_ready().is_ok()); assert!(srv.poll_ready().is_ok());
let res = srv.call("srv").poll(); let res = srv.call("srv").poll();
assert!(res.is_ok()); assert!(res.is_ok());
@ -268,19 +267,19 @@ mod tests {
} }
} }
// #[test] #[test]
// fn test_new_service_fn() { fn test_new_service_fn() {
// let new_srv = ApplyNewService::new_fn( let new_srv = ApplyNewService::new_fn(
// || Ok(Srv), || Ok::<_, ()>(Srv),
// |req: &'static str, srv| srv.call(()).map(move |res| (req, res)), |req: &'static str, srv| srv.call(()).map(move |res| (req, res)),
// ); );
// if let Async::Ready(mut srv) = new_srv.new_service().poll().unwrap() { if let Async::Ready(mut srv) = new_srv.new_service().poll().unwrap() {
// assert!(srv.poll_ready().is_ok()); assert!(srv.poll_ready().is_ok());
// let res = srv.call("srv").poll(); let res = srv.call("srv").poll();
// assert!(res.is_ok()); assert!(res.is_ok());
// assert_eq!(res.unwrap(), Async::Ready(("srv", ()))); assert_eq!(res.unwrap(), Async::Ready(("srv", ())));
// } else { } else {
// panic!() panic!()
// } }
// } }
} }