summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/analysis/scan/pyapi.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/analysis/scan/pyapi.py b/tests/analysis/scan/pyapi.py
index 4b066f3..ff3143f 100644
--- a/tests/analysis/scan/pyapi.py
+++ b/tests/analysis/scan/pyapi.py
@@ -28,7 +28,7 @@ class TestRostPythonAPI(ChrysalideTestCase):
e = ScanExpression()
- def testBooleanComparison(self):
+ def __TODO__testBooleanComparison(self):
"""Compare custom scan expressions."""
class StrLenExpr(ScanExpression):
@@ -88,3 +88,26 @@ class TestRostPythonAPI(ChrysalideTestCase):
transformed = mod.transform(source)
self.assertEqual(source[::-1], transformed[0])
+
+
+ def testBytePatternModifiersAPI(self):
+ """Validate the API for pattern modifiers."""
+
+ mod = find_token_modifiers_for_name('plain')
+ self.assertIsNotNone(mod)
+
+ source = [ b'ABC', b'01234' ]
+ transformed = mod.transform(source)
+
+ self.assertEqual(len(source), len(transformed))
+ self.assertEqual(source[0], transformed[0])
+ self.assertEqual(source[1], transformed[1])
+
+
+ mod = find_token_modifiers_for_name('xor')
+ self.assertIsNotNone(mod)
+
+ source = [ b'ABC' ]
+ transformed = mod.transform(source, 0x20)
+
+ self.assertEqual(transformed[0], b'abc')