mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-11 15:20:58 +00:00
Add some ignored tests for sub-globbing
This commit is contained in:
parent
166d1f5e5a
commit
937b325e3a
@ -155,4 +155,42 @@ mod test {
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("/srcode/exa.ipr")));
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("/srcode/exa.iws")));
|
||||
}
|
||||
|
||||
#[test] #[ignore]
|
||||
fn ignore_relatively() {
|
||||
let ignores = test_cache(".", vec![ "target" ]);
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/project/target")));
|
||||
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("./.target")));
|
||||
}
|
||||
|
||||
#[test] #[ignore]
|
||||
fn ignore_relatively_sometimes() {
|
||||
let ignores = test_cache(".", vec![ "project/target" ]);
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("./target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/project/target")));
|
||||
}
|
||||
|
||||
#[test] #[ignore]
|
||||
fn ignore_relatively_absolutely() {
|
||||
let ignores = test_cache(".", vec![ "/project/target" ]);
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("./target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/project/target")));
|
||||
}
|
||||
|
||||
#[test] #[ignore] // not 100% sure if dot works this way...
|
||||
fn ignore_relatively_absolutely_dot() {
|
||||
let ignores = test_cache(".", vec![ "./project/target" ]);
|
||||
assert_eq!(false, ignores.is_ignored(Path::new("./target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/target")));
|
||||
assert_eq!(true, ignores.is_ignored(Path::new("./project/project/project/target")));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user