From d44fd008aecf42dc4b6a6a3260110e22d16f1c78 Mon Sep 17 00:00:00 2001 From: mike-hunhoff Date: Wed, 24 Mar 2021 13:22:04 -0600 Subject: [PATCH 1/2] improve unit tests for strings containing special characters Co-authored-by: Moritz --- tests/test_rules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_rules.py b/tests/test_rules.py index ffbf81aa..9219c41e 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -695,6 +695,7 @@ def test_string_values_special_characters(): r = capa.rules.Rule.from_yaml(rule) children = list(r.statement.get_children()) assert (String("hello\r\nworld") in children) == True + assert (String("bye\nbye") in children) == True def test_regex_values_always_string(): From 49d1af77980666af0ad21829eb0edb4384a252f2 Mon Sep 17 00:00:00 2001 From: mike-hunhoff Date: Wed, 24 Mar 2021 13:22:18 -0600 Subject: [PATCH 2/2] improve unit tests for strings containing special characters Co-authored-by: Moritz --- tests/test_rules.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_rules.py b/tests/test_rules.py index 9219c41e..8bc42e8c 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -690,6 +690,8 @@ def test_string_values_special_characters(): features: - or: - string: "hello\\r\\nworld" + - string: "bye\\nbye" + description: "test description" """ ) r = capa.rules.Rule.from_yaml(rule)