We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc70324 commit d48444dCopy full SHA for d48444d
src/ignore_path.rs
@@ -30,3 +30,26 @@ impl IgnorePathSet {
30
}
31
32
33
+
34
+#[cfg(test)]
35
+mod test {
36
+ use crate::config::{Config, FileName};
37
+ use crate::ignore_path::IgnorePathSet;
38
+ use std::path::PathBuf;
39
40
+ #[test]
41
+ fn test_ignore_path_set() {
42
+ let config = Config::from_toml(
43
+ "ignore = [
44
+ \"foo.rs\",
45
+ \"bar_dir/*\",
46
+ ]",
47
+ )
48
+ .unwrap();
49
+ let ignore_path_set = IgnorePathSet::from_ignore_list(&config.ignore()).unwrap();
50
51
+ assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs"))));
52
+ assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("bar_dir/baz.rs"))));
53
+ assert!(!ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/bar.rs"))));
54
+ }
55
+}
0 commit comments