Skip to main content

slopguard_rules/
lib.rs

1use rust_embed::Embed;
2
3#[derive(Embed)]
4#[folder = "rules/"]
5pub struct BuiltinRules;
6
7#[cfg(test)]
8mod tests {
9    use super::*;
10
11    #[test]
12    fn builtin_rules_embeds_subdirectories() {
13        let files: Vec<_> = BuiltinRules::iter().collect();
14        assert!(
15            files.iter().any(|f| f.starts_with("slop/")),
16            "should contain slop/ files, got: {files:?}"
17        );
18        assert!(
19            files.iter().any(|f| f.starts_with("security/")),
20            "should contain security/ files, got: {files:?}"
21        );
22        assert!(
23            files.iter().any(|f| f.starts_with("correctness/")),
24            "should contain correctness/ files, got: {files:?}"
25        );
26    }
27}