Glob pattern ignore tests

This commit is contained in:
Benjamin Sago 2017-09-28 19:03:15 +01:00
parent 541e6855f2
commit 166d1f5e5a

View File

@ -142,4 +142,17 @@ mod test {
assert_eq!(false, ignores.is_ignored(Path::new("/vagrant/src")));
assert_eq!(true, ignores.is_ignored(Path::new("/vagrant/target")));
}
#[test]
fn ignore_some_globs() {
let ignores = test_cache("/vagrant", vec![ "*.ipr", "*.iws", ".docker" ]);
assert_eq!(true, ignores.is_ignored(Path::new("/vagrant/exa.ipr")));
assert_eq!(true, ignores.is_ignored(Path::new("/vagrant/exa.iws")));
assert_eq!(false, ignores.is_ignored(Path::new("/vagrant/exa.iwiwal")));
assert_eq!(true, ignores.is_ignored(Path::new("/vagrant/.docker")));
assert_eq!(false, ignores.is_ignored(Path::new("/vagrant/exa.docker")));
assert_eq!(false, ignores.is_ignored(Path::new("/srcode/exa.ipr")));
assert_eq!(false, ignores.is_ignored(Path::new("/srcode/exa.iws")));
}
}