diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-08-06 22:39:02 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-08-06 22:39:02 (GMT) |
commit | 8bbd5527b66e1edd0a4a8a955dba095042b22f59 (patch) | |
tree | c284dfa7df635de0811f1bbd2353ae7aea21f0d9 /tests/analysis/scan | |
parent | a02116de1290b1f5c7deda43071df762cebc9b84 (diff) |
Avoid to count the matches of a non-existing pattern.
Diffstat (limited to 'tests/analysis/scan')
-rw-r--r-- | tests/analysis/scan/fuzzing.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/analysis/scan/fuzzing.py b/tests/analysis/scan/fuzzing.py index 0870ed4..2140972 100644 --- a/tests/analysis/scan/fuzzing.py +++ b/tests/analysis/scan/fuzzing.py @@ -46,3 +46,20 @@ rule test { with self.assertRaisesRegex(ValueError, 'Unable to create content scanner'): scanner = ContentScanner(rule) + + + def testNonExistingPattern(self): + """Avoid to count the matches of a non-existing pattern.""" + + rule = ''' +rule test { + + condition: + #badid + +} +''' + + with self.assertRaisesRegex(ValueError, 'Unable to create content scanner'): + + scanner = ContentScanner(rule) |