tests cleanup

This commit is contained in:
Nikolay Kim 2020-04-26 21:04:32 +06:00
parent 2d17a50d25
commit 34d115abba
3 changed files with 14 additions and 13 deletions

View file

@ -715,9 +715,12 @@ mod tests {
#[test]
fn test_static_tail() {
let re = ResourceDef::new("/*");
let re = ResourceDef::new("/*".to_string());
let tree = Tree::new(&re, 1);
assert_eq!(tree.find(&mut Path::new("/")), None);
assert_eq!(
tree.find(&mut Path::new(bytestring::ByteString::from_static("/"))),
None
);
assert_eq!(tree.find(&mut Path::new("/profile")), Some(1));
assert_eq!(tree.find(&mut Path::new("/user/profile")), Some(1));
assert_eq!(tree.find(&mut Path::new("/user/2345")), Some(1));
@ -726,7 +729,7 @@ mod tests {
assert_eq!(tree.find(&mut Path::new("/2345/sdg")), Some(1));
assert_eq!(tree.find(&mut Path::new("/user/2345/sdg")), Some(1));
let re = ResourceDef::new("/user*");
let re = ResourceDef::new(&("/user*".to_string()));
let tree = Tree::new(&re, 1);
assert_eq!(tree.find(&mut Path::new("/user/profile")), Some(1));
assert_eq!(tree.find(&mut Path::new("/user/2345")), Some(1));