Skip to content

Commit

Permalink
test: add a small test on word boundary with ac matches
Browse files Browse the repository at this point in the history
  • Loading branch information
vthib committed Jul 9, 2023
1 parent 0490dbf commit e058b8f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions boreal/tests/it/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,25 @@ rule a {{
checker.check(&to_wide(b"zz a>>>34"), true);
}

#[test]
fn test_variable_boundary_ac_confirm() {
// Make sure the boundary is taken into account when confirming an ac match.
let checker = Checker::new(
r#"
rule a {
strings:
$a = /\Wabcd\W/
condition:
$a
}"#,
);

checker.check(b"aabcde", false);
checker.check(b"<abcde", false);
checker.check(b"aabcd>", false);
checker.check(b"<abcd>", true);
}

#[test]
fn test_variable_string_modifiers() {
// \x76 is 'v'
Expand Down

0 comments on commit e058b8f

Please sign in to comment.