From e058b8fd80910fee4c92cbae1c5cecda619b1ff1 Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Sun, 9 Jul 2023 22:31:17 +0200 Subject: [PATCH] test: add a small test on word boundary with ac matches --- boreal/tests/it/variables.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/boreal/tests/it/variables.rs b/boreal/tests/it/variables.rs index 573f7ea3..eaa11fdb 100644 --- a/boreal/tests/it/variables.rs +++ b/boreal/tests/it/variables.rs @@ -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"", false); + checker.check(b"", true); +} + #[test] fn test_variable_string_modifiers() { // \x76 is 'v'