1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

update tests

This commit is contained in:
Nikolay Kim 2017-12-05 11:43:41 -08:00
parent a83d9b24ae
commit 86d7290f9e
2 changed files with 7 additions and 7 deletions

View File

@ -395,11 +395,11 @@ mod tests {
let mut rec = RouteRecognizer::<usize>::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()
}

View File

@ -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();