diff --git a/src/acl.rs b/src/acl.rs index 538a1a7..b19ab83 100644 --- a/src/acl.rs +++ b/src/acl.rs @@ -309,7 +309,7 @@ mod tests { assert_eq!(s, mask.to_string()); assert_eq!(mask.chunks, None); let s = ""; - assert_eq!(s.parse::().is_err(), true); + assert!(s.parse::().is_err()); let s = "data/#"; let mask: PathMask = s.parse().unwrap(); assert_eq!(s, mask.to_string()); @@ -333,34 +333,34 @@ mod tests { let p = PathMaskList::from_str_list(&["test/tests", "+/xxx", "zzz/+/222", "abc", "a/b/#/c"]) .unwrap(); - assert_eq!(p.matches("test"), false); - assert_eq!(p.matches("test/tests"), true); - assert_eq!(p.matches("test/tests2"), false); - assert_eq!(p.matches("aaa/xxx"), true); - assert_eq!(p.matches("aaa/xxx/123"), false); - assert_eq!(p.matches("zzz/xxx/222"), true); - assert_eq!(p.matches("zzz/xxx/222/555"), false); - assert_eq!(p.matches("zzz/xxx/223"), false); - assert_eq!(p.matches("abc"), true); - assert_eq!(p.matches("abd"), false); - assert_eq!(p.matches("abc/xxx"), true); - assert_eq!(p.matches("abc/zzz"), false); - assert_eq!(p.matches("a/b/zzz"), true); - assert_eq!(p.matches("a/b/zzz/xxx"), true); + assert!(!p.matches("test")); + assert!(p.matches("test/tests")); + assert!(!p.matches("test/tests2")); + assert!(p.matches("aaa/xxx")); + assert!(!p.matches("aaa/xxx/123")); + assert!(p.matches("zzz/xxx/222")); + assert!(!p.matches("zzz/xxx/222/555")); + assert!(!p.matches("zzz/xxx/223")); + assert!(p.matches("abc")); + assert!(!p.matches("abd")); + assert!(p.matches("abc/xxx")); + assert!(!p.matches("abc/zzz")); + assert!(p.matches("a/b/zzz")); + assert!(p.matches("a/b/zzz/xxx")); let p = PathMaskList::from_str_list(&["#"]).unwrap(); - assert_eq!(p.matches("test"), true); - assert_eq!(p.matches("test/tests"), true); - assert_eq!(p.matches("test/tests2"), true); - assert_eq!(p.matches("aaa/xxx"), true); - assert_eq!(p.matches("aaa/xxx/123"), true); - assert_eq!(p.matches("zzz/xxx/222"), true); - assert_eq!(p.matches("zzz/xxx/222/555"), true); - assert_eq!(p.matches("zzz/xxx/223"), true); - assert_eq!(p.matches("abc"), true); - assert_eq!(p.matches("abd"), true); - assert_eq!(p.matches("abc/xxx"), true); - assert_eq!(p.matches("abc/zzz"), true); - assert_eq!(p.matches("a/b/zzz"), true); - assert_eq!(p.matches("a/b/zzz/xxx"), true); + assert!(p.matches("test")); + assert!(p.matches("test/tests")); + assert!(p.matches("test/tests2")); + assert!(p.matches("aaa/xxx")); + assert!(p.matches("aaa/xxx/123")); + assert!(p.matches("zzz/xxx/222")); + assert!(p.matches("zzz/xxx/222/555")); + assert!(p.matches("zzz/xxx/223")); + assert!(p.matches("abc")); + assert!(p.matches("abd")); + assert!(p.matches("abc/xxx")); + assert!(p.matches("abc/zzz")); + assert!(p.matches("a/b/zzz")); + assert!(p.matches("a/b/zzz/xxx")); } }