mirror of
https://github.com/mandiant/capa.git
synced 2025-12-23 07:28:34 -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
|
||||
# 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.
|
||||
import sys
|
||||
|
||||
import viv_utils
|
||||
import envi.memory
|
||||
import viv_utils.flirt
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user