From 491d43aa8c4374a895808186a85005466fab5666 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 29 Dec 2017 11:49:36 -0800 Subject: [PATCH] update tests --- src/httprequest.rs | 7 ++++--- src/router.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/httprequest.rs b/src/httprequest.rs index 6d763e2f3..ce0667ba0 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -644,6 +644,7 @@ mod tests { use router::Pattern; use resource::Resource; use test::TestRequest; + use server::ServerSettings; #[test] fn test_debug() { @@ -720,7 +721,7 @@ mod tests { resource.name("index"); let mut map = HashMap::new(); map.insert(Pattern::new("index", "/{key}/"), Some(resource)); - let (router, _) = Router::new("", map); + let (router, _) = Router::new("", ServerSettings::default(), map); assert!(router.recognize(&mut req).is_some()); assert_eq!(req.match_info().get("key"), Some("value")); @@ -822,7 +823,7 @@ mod tests { resource.name("index"); let mut map = HashMap::new(); map.insert(Pattern::new("index", "/user/{name}.{ext}"), Some(resource)); - let (router, _) = Router::new("", map); + let (router, _) = Router::new("", ServerSettings::default(), map); assert!(router.has_route("/user/test.html")); assert!(!router.has_route("/test/unknown")); @@ -849,7 +850,7 @@ mod tests { resource.name("index"); let mut map = HashMap::new(); map.insert(Pattern::new("youtube", "https://youtube.com/watch/{video_id}"), None); - let (router, _) = Router::new::<()>("", map); + let (router, _) = Router::new::<()>("", ServerSettings::default(), map); assert!(!router.has_route("https://youtube.com/watch/unknown")); let req = req.with_state(Rc::new(()), router); diff --git a/src/router.rs b/src/router.rs index 2300dce55..92eb01c3e 100644 --- a/src/router.rs +++ b/src/router.rs @@ -312,7 +312,7 @@ mod tests { routes.insert(Pattern::new("", "/v{val}/{val2}/index.html"), Some(Resource::default())); routes.insert(Pattern::new("", "/v/{tail:.*}"), Some(Resource::default())); routes.insert(Pattern::new("", "{test}/index.html"), Some(Resource::default())); - let (rec, _) = Router::new::<()>("", routes); + let (rec, _) = Router::new::<()>("", ServerSettings::default(), routes); let mut req = HttpRequest::new( Method::GET, Uri::from_str("/name").unwrap(),