add test for directory source ordering

This commit is contained in:
Robin Malfait 2026-08-12 15:33:48 +02:00
parent 367b59371f
commit 7536feb801
No known key found for this signature in database

View file

@ -4305,6 +4305,23 @@ mod scanner {
assert!(candidates.is_empty());
}
#[test]
fn later_directory_sources_override_earlier_not_sources() {
let ScanResult {
candidates, files, ..
} = scan_with_globs(
&[("src/index.html", "content-['src/index.html']")],
vec![
"@source '**/*'",
"@source not './src'",
"@source './src'",
],
);
assert_eq!(candidates, vec!["content-['src/index.html']"]);
assert_eq!(files, vec!["src/index.html"]);
}
#[test]
fn wildcard_not_sources_exclude_matching_directories() {
let ScanResult {