Skip to content

Commit

Permalink
fix glob matching
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed May 9, 2023
1 parent b032330 commit d868be4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions crates/turbo-tasks-fs/src/glob.rs
Expand Up @@ -50,8 +50,7 @@ impl Glob {
pub fn execute(&self, path: &str) -> bool {
let match_partial = path.ends_with('/');
self.iter_matches(path, true, match_partial)
.next()
.is_some()
.any(|result| matches!(result, ("", _)))
}

fn iter_matches<'a>(
Expand Down Expand Up @@ -416,4 +415,14 @@ mod tests {

assert!(glob.execute(path));
}

#[rstest]
#[case::early_end("*.raw", "hello.raw.js")]
fn glob_not_matching(#[case] glob: &str, #[case] path: &str) {
let glob = Glob::parse(glob).unwrap();

println!("{glob:?} {path}");

assert!(!glob.execute(path));
}
}

0 comments on commit d868be4

Please sign in to comment.