mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-28 00:42:58 +01:00
update apply tests
This commit is contained in:
parent
a91b9a2f9e
commit
20cff6fc0b
@ -173,7 +173,7 @@ mod tests {
|
|||||||
use futures::future::{ok, FutureResult};
|
use futures::future::{ok, FutureResult};
|
||||||
use futures::{Async, Future, Poll};
|
use futures::{Async, Future, Poll};
|
||||||
|
|
||||||
use service::{Service, ServiceExt};
|
use service::{IntoService, Service, ServiceExt};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct Srv;
|
struct Srv;
|
||||||
@ -194,8 +194,12 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_call() {
|
fn test_call() {
|
||||||
let mut srv =
|
let blank = |req| Ok(req);
|
||||||
Srv.apply(|req: &'static str, srv| srv.call(()).map(move |res| (req, res)));
|
|
||||||
|
let mut srv = blank.into_service().apply(Srv, |req: &'static str, srv| {
|
||||||
|
srv.call(()).map(move |res| (req, res))
|
||||||
|
});
|
||||||
|
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", ())));
|
||||||
|
Loading…
Reference in New Issue
Block a user