Compare commits

...

1 Commits

Author SHA1 Message Date
Yoshua Wuyts 28236c2eec v0.3.0 2020-12-24 14:24:48 +01:00
2 changed files with 18 additions and 1 deletions

View File

@ -6,5 +6,5 @@ repository = "https://github.com/rustasync/route-recognizer"
keywords = ["router", "url"]
edition = "2018"
version = "0.2.0"
version = "0.3.0"
authors = ["wycats", "rustasync"]

View File

@ -554,4 +554,21 @@ mod tests {
let m = router.recognize("/4.static.static");
assert!(m.is_err());
}
#[test]
fn test_string_encoding() {
let mut router = Router::new();
router.add("/foo%2Fbar", "Hello".to_string());
router.add("/foo bar", "Hello".to_string());
// assert_eq!(
// router.recognize("/foo%2fbar").unwrap().handler().as_str(),
// "Hello"
// );
assert_eq!(
router.recognize("/foo%20bar").unwrap().handler().as_str(),
"Hello"
);
}
}