Compare commits
1 Commits
7b8a9e0087
...
28236c2eec
Author | SHA1 | Date |
---|---|---|
Yoshua Wuyts | 28236c2eec |
|
@ -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"]
|
||||
|
|
17
src/lib.rs
17
src/lib.rs
|
@ -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"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue