mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-26 13:56:27 +00:00
Test some actual ignore caches
This commit is contained in:
parent
476299e21f
commit
541e6855f2
@ -125,6 +125,9 @@ mod test {
|
||||
}
|
||||
|
||||
|
||||
fn test_cache(dir: &'static str, pats: Vec<&str>) -> IgnoreCache {
|
||||
IgnoreCache { entries: RwLock::new(vec![ (dir.into(), IgnorePatterns::parse_from_iter(pats.into_iter()).0) ]) }
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_empty_cache_ignores_nothing() {
|
||||
@ -132,4 +135,11 @@ mod test {
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("/usr/bin/drinking")));
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("target/debug/exa")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_nonempty_cache_ignores_some_things() {
|
||||
let ignores = test_cache("/vagrant", vec![ "target" ]);
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("/vagrant/src")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("/vagrant/target")));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user