Skip to content

Commit 28236c2

Browse files
committed
v0.3.0
1 parent fc38dad commit 28236c2

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ repository = "https://github.com/rustasync/route-recognizer"
66
keywords = ["router", "url"]
77
edition = "2018"
88

9-
version = "0.2.0"
9+
version = "0.3.0"
1010
authors = ["wycats", "rustasync"]

src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,4 +554,21 @@ mod tests {
554554
let m = router.recognize("/4.static.static");
555555
assert!(m.is_err());
556556
}
557+
558+
#[test]
559+
fn test_string_encoding() {
560+
let mut router = Router::new();
561+
router.add("/foo%2Fbar", "Hello".to_string());
562+
router.add("/foo bar", "Hello".to_string());
563+
564+
// assert_eq!(
565+
// router.recognize("/foo%2fbar").unwrap().handler().as_str(),
566+
// "Hello"
567+
// );
568+
569+
assert_eq!(
570+
router.recognize("/foo%20bar").unwrap().handler().as_str(),
571+
"Hello"
572+
);
573+
}
557574
}

0 commit comments

Comments
 (0)