add test for wildcard directory source exclusions

This commit is contained in:
Robin Malfait 2026-08-12 15:31:51 +02:00
parent 35d2ea025d
commit fb43708997
No known key found for this signature in database

View file

@ -4305,6 +4305,22 @@ mod scanner {
assert!(candidates.is_empty());
}
#[test]
fn wildcard_not_sources_exclude_matching_directories() {
let ScanResult {
candidates, files, ..
} = scan_with_globs(
&[
("src/bar/index.html", "content-['src/bar/index.html']"),
("src/foo/index.html", "content-['src/foo/index.html']"),
],
vec!["@source './src/**/*.html'", "@source not './src/ba*'"],
);
assert_eq!(candidates, vec!["content-['src/foo/index.html']"]);
assert_eq!(files, vec!["src/foo/index.html"]);
}
#[test]
fn test_extract_used_css_variables_from_css() {
let dir = tempdir().unwrap().into_path();