Skip to content

Commit

Permalink
test: add test on widening empty regex node
Browse files Browse the repository at this point in the history
  • Loading branch information
vthib committed Feb 12, 2023
1 parent 7062d55 commit 6e893b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boreal/tests/it/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ fn to_wide(e: &[u8]) -> Vec<u8> {

#[test]
fn test_variable_regex_wide() {
// Without yara, it does not allow empty regex nodes
let checker = Checker::new_without_yara(
r#"
rule a {
strings:
$a = /()/ wide
condition:
$a
}"#,
);
checker.check(b"", false);
checker.check(b"\0", true);

let checker = build_checker("abc", "wide");
checker.check(b"abc", false);
checker.check(b"a\0b\0c\0", true);
Expand Down

0 comments on commit 6e893b6

Please sign in to comment.