diff options
Diffstat (limited to 'tests/analysis')
| -rw-r--r-- | tests/analysis/scan/fuzzing.py | 39 | 
1 files changed, 38 insertions, 1 deletions
| diff --git a/tests/analysis/scan/fuzzing.py b/tests/analysis/scan/fuzzing.py index 5d99c35..1957f72 100644 --- a/tests/analysis/scan/fuzzing.py +++ b/tests/analysis/scan/fuzzing.py @@ -176,7 +176,9 @@ rule test {  }  ''' -        self.check_rule_failure(rule) +        with self.assertRaisesRegex(ValueError, 'Unable to create content scanner'): + +            scanner = ContentScanner(rule)      def testAllocations(self): @@ -212,3 +214,38 @@ rule test {  '''          self.check_rule_success(rule, cnt) + + +    def testValidHexRangeMerge(self): +        """Merge valid hexadecimal ranges.""" + +        rule = ''' +rule test { + +   bytes: +      $a = { [0] ?? } + +   condition: +      $a + +} +''' + +        with self.assertRaisesRegex(ValueError, 'Unable to create content scanner'): + +            scanner = ContentScanner(rule) + + +        rule = ''' +rule test { + +   bytes: +      $a = { [2] ?? } + +   condition: +      $a + +} +''' + +        self.check_rule_failure(rule) | 
