mirror of
https://github.com/mandiant/capa.git
synced 2025-12-22 23:26:21 -08:00
rules: add tests demonstrating mnemonic descriptions
This commit is contained in:
@@ -5,8 +5,6 @@
|
|||||||
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and limitations under the License.
|
# See the License for the specific language governing permissions and limitations under the License.
|
||||||
import sys
|
|
||||||
|
|
||||||
import viv_utils
|
import viv_utils
|
||||||
import envi.memory
|
import envi.memory
|
||||||
import viv_utils.flirt
|
import viv_utils.flirt
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ def test_rule_descriptions():
|
|||||||
description: string description
|
description: string description
|
||||||
- string: '/myregex/'
|
- string: '/myregex/'
|
||||||
description: regex description
|
description: regex description
|
||||||
|
- mnemonic: inc = mnemonic description
|
||||||
# TODO - count(number(2 = number description)): 2
|
# TODO - count(number(2 = number description)): 2
|
||||||
- or:
|
- or:
|
||||||
- description: or description
|
- description: or description
|
||||||
@@ -104,6 +105,8 @@ def test_rule_descriptions():
|
|||||||
for child in statement.get_children():
|
for child in statement.get_children():
|
||||||
rec(child)
|
rec(child)
|
||||||
else:
|
else:
|
||||||
|
if isinstance(statement.value, str):
|
||||||
|
assert "description" not in statement.value
|
||||||
assert statement.description == statement.name + " description"
|
assert statement.description == statement.name + " description"
|
||||||
|
|
||||||
rec(r.statement)
|
rec(r.statement)
|
||||||
|
|||||||
Reference in New Issue
Block a user