Fail all folders on extension check
This commit is contained in:
parent
6cebaf204f
commit
42d64d0a6d
|
@ -128,8 +128,8 @@ impl Filterer for GlobsetFilterer {
|
|||
|
||||
if !self.extensions.is_empty() {
|
||||
if is_dir {
|
||||
trace!("omitted from extension check due to being a dir");
|
||||
continue;
|
||||
trace!("failed on extension check due to being a dir");
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
if let Some(ext) = path.extension() {
|
||||
|
|
|
@ -297,6 +297,25 @@ async fn ignores_take_precedence() {
|
|||
filterer.file_does_pass("FINAL-FINAL.docx");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn extensions_fail_dirs() {
|
||||
let filterer = filt(&[], &[], &["py"]).await;
|
||||
|
||||
filterer.file_does_pass("Cargo.py");
|
||||
filterer.file_doesnt_pass("Cargo.toml");
|
||||
filterer.dir_doesnt_pass("Cargo");
|
||||
filterer.dir_doesnt_pass("Cargo.toml");
|
||||
filterer.dir_doesnt_pass("Cargo.py");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn extensions_fail_extensionless() {
|
||||
let filterer = filt(&[], &[], &["py"]).await;
|
||||
|
||||
filterer.file_does_pass("Cargo.py");
|
||||
filterer.file_doesnt_pass("Cargo");
|
||||
}
|
||||
|
||||
// The following tests replicate the "buggy"/"confusing" watchexec v1 behaviour.
|
||||
|
||||
#[tokio::test]
|
||||
|
|
Loading…
Reference in New Issue