mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-22 03:55:11 +00:00
Simplify boolean assertions in tests
This commit is contained in:
parent
bbea87db91
commit
72b2119a34
@ -346,31 +346,31 @@ mod test_ignores {
|
||||
#[test]
|
||||
fn empty_matches_nothing() {
|
||||
let pats = IgnorePatterns::empty();
|
||||
assert_eq!(false, pats.is_ignored("nothing"));
|
||||
assert_eq!(false, pats.is_ignored("test.mp3"));
|
||||
assert!(!pats.is_ignored("nothing"));
|
||||
assert!(!pats.is_ignored("test.mp3"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ignores_a_glob() {
|
||||
let (pats, fails) = IgnorePatterns::parse_from_iter(vec![ "*.mp3" ]);
|
||||
assert!(fails.is_empty());
|
||||
assert_eq!(false, pats.is_ignored("nothing"));
|
||||
assert_eq!(true, pats.is_ignored("test.mp3"));
|
||||
assert!(!pats.is_ignored("nothing"));
|
||||
assert!(pats.is_ignored("test.mp3"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ignores_an_exact_filename() {
|
||||
let (pats, fails) = IgnorePatterns::parse_from_iter(vec![ "nothing" ]);
|
||||
assert!(fails.is_empty());
|
||||
assert_eq!(true, pats.is_ignored("nothing"));
|
||||
assert_eq!(false, pats.is_ignored("test.mp3"));
|
||||
assert!(pats.is_ignored("nothing"));
|
||||
assert!(!pats.is_ignored("test.mp3"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ignores_both() {
|
||||
let (pats, fails) = IgnorePatterns::parse_from_iter(vec![ "nothing", "*.mp3" ]);
|
||||
assert!(fails.is_empty());
|
||||
assert_eq!(true, pats.is_ignored("nothing"));
|
||||
assert_eq!(true, pats.is_ignored("test.mp3"));
|
||||
assert!(pats.is_ignored("nothing"));
|
||||
assert!(pats.is_ignored("test.mp3"));
|
||||
}
|
||||
}
|
||||
|
@ -743,6 +743,6 @@ mod matches_test {
|
||||
fn no_count() {
|
||||
let flags = MatchedFlags { flags: Vec::new(), strictness: Strictness::UseLastArguments };
|
||||
|
||||
assert_eq!(flags.has(&COUNT).unwrap(), false);
|
||||
assert!(!flags.has(&COUNT).unwrap());
|
||||
}
|
||||
}
|
||||
|
@ -257,15 +257,15 @@ mod iter_test {
|
||||
|
||||
let next = iter.next().unwrap();
|
||||
assert_eq!(&"first", next.1);
|
||||
assert_eq!(false, next.0.last);
|
||||
assert!(!next.0.last);
|
||||
|
||||
let next = iter.next().unwrap();
|
||||
assert_eq!(&"middle", next.1);
|
||||
assert_eq!(false, next.0.last);
|
||||
assert!(!next.0.last);
|
||||
|
||||
let next = iter.next().unwrap();
|
||||
assert_eq!(&"last", next.1);
|
||||
assert_eq!(true, next.0.last);
|
||||
assert!(next.0.last);
|
||||
|
||||
assert!(iter.next().is_none());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user