From 86d7290f9ef6a5d7d92d599aaeeffcd4e841b9bb Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 5 Dec 2017 11:43:41 -0800 Subject: [PATCH] update tests --- src/recognizer.rs | 12 ++++++------ tests/test_httprequest.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/recognizer.rs b/src/recognizer.rs index 4b08aaec..2ee59679 100644 --- a/src/recognizer.rs +++ b/src/recognizer.rs @@ -395,11 +395,11 @@ mod tests { let mut rec = RouteRecognizer::::default(); let routes = vec![ - ("/name", 1), - ("/name/{val}", 2), - ("/name/{val}/index.html", 3), - ("/v{val}/{val2}/index.html", 4), - ("/v/{tail:.*}", 5), + ("/name", None, 1), + ("/name/{val}", None, 2), + ("/name/{val}/index.html", None, 3), + ("/v{val}/{val2}/index.html", None, 4), + ("/v/{tail:.*}", None, 5), ]; rec.set_routes(routes); @@ -434,7 +434,7 @@ mod tests { } fn assert_parse(pattern: &str, expected_re: &str) -> Regex { - let re_str = parse(pattern); + let (re_str, _) = parse(pattern); assert_eq!(&*re_str, expected_re); Regex::new(&re_str).unwrap() } diff --git a/tests/test_httprequest.rs b/tests/test_httprequest.rs index e69ee924..794864cd 100644 --- a/tests/test_httprequest.rs +++ b/tests/test_httprequest.rs @@ -92,7 +92,7 @@ fn test_request_match_info() { let mut req = HttpRequest::new(Method::GET, Uri::from_str("/value/?id=test").unwrap(), Version::HTTP_11, HeaderMap::new(), Payload::empty()); - let rec = RouteRecognizer::new("/".to_owned(), vec![("/{key}/".to_owned(), 1)]); + let rec = RouteRecognizer::new("/".to_owned(), vec![("/{key}/".to_owned(), None, 1)]); let (params, _) = rec.recognize(req.path()).unwrap(); let params = params.unwrap();