rules: add tests demonstrating mnemonic descriptions

This commit is contained in:
William Ballenthin
2021-05-18 13:35:24 -06:00
parent 7b62b589f7
commit ec5cec619d
2 changed files with 3 additions and 2 deletions

View File

@@ -83,6 +83,7 @@ def test_rule_descriptions():
description: string description
- string: '/myregex/'
description: regex description
- mnemonic: inc = mnemonic description
# TODO - count(number(2 = number description)): 2
- or:
- description: or description
@@ -104,6 +105,8 @@ def test_rule_descriptions():
for child in statement.get_children():
rec(child)
else:
if isinstance(statement.value, str):
assert "description" not in statement.value
assert statement.description == statement.name + " description"
rec(r.statement)