Add test case for comment inside hex string.
Also move all comments-related tests to the test_comments function.
@@ -626,26 +626,6 @@ static void test_hex_strings()
condition: $a }",
"1234567890");
- assert_true_rule(
- "rule test { \
- strings: $a = { 31 32 [-] // Inline comment\n\r \
- 38 39 } \
- condition: $a }",
- "1234567890");
-
- assert_true_rule(
- "rule test { \
- strings: $a = { 31 32 /* Inline comment */ [-] 38 39 } \
- condition: $a }",
- "1234567890");
-
- assert_true_rule(
- "rule test { \
- strings: $a = { 31 32 /* Inline multi-line\n\r \
- comment */ [-] 38 39 } \
- condition: $a }",
- "1234567890");
-
assert_true_rule(
"rule test { \
strings: $a = {\n 31 32 [-] 38 39 \n\r} \
@@ -1477,6 +1457,32 @@ static void test_comments()
true\n\
}",
NULL);
+
+ assert_true_rule(
+ "rule test { \
+ strings: $a = { 31 32 [-] // Inline comment\n\r \
+ 38 39 } \
+ condition: $a }",
+ "1234567890");
+
+ assert_true_rule(
+ "rule test { \
+ strings: $a = { 31 32 /* Inline comment */ [-] 38 39 } \
+ condition: $a }",
+ "1234567890");
+
+ assert_true_rule(
+ "rule test { \
+ strings: $a = { 31 32 /* Inline multi-line\n\r \
+ comment */ [-] 38 39 } \
+ condition: $a }",
+ "1234567890");
+
+ assert_true_rule(
+ "rule test { \
+ strings: $a = { 31 /* A */ 32 /*B*/ 33 34 35 36 /* C */} \
+ condition: $a }",
+ "1234567890");
}
static void test_matches_operator()
