summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-07-24 05:15:38 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-07-24 05:23:19 -0400
commit7b8332686eb864186b2cb6c1fe2909c96995fcd1 (patch)
treef48603223cad143324db4f53e312eaa5645676e4
parent41c0a15e09a4388ff2dbb77153d6ba2d0f629ebc (diff)
chore: add tests
-rw-r--r--test/corpus/expressions.txt14
-rw-r--r--test/corpus/preprocessor.txt8
2 files changed, 20 insertions, 2 deletions
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index d975ce93c..d0a3a907f 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -504,6 +504,7 @@ int main() {
q /= r;
*s++ = 1;
(*t) = 1;
+ a *= ((b!=c) ? d : e);
}
--------------------------------------------------------------------------------
@@ -573,7 +574,18 @@ int main() {
left: (parenthesized_expression
(pointer_expression
argument: (identifier)))
- right: (number_literal))))))
+ right: (number_literal)))
+ (expression_statement
+ (assignment_expression
+ left: (identifier)
+ right: (parenthesized_expression
+ (conditional_expression
+ condition: (parenthesized_expression
+ (binary_expression
+ left: (identifier)
+ right: (identifier)))
+ consequence: (identifier)
+ alternative: (identifier))))))))
================================================================================
Pointer operations
diff --git a/test/corpus/preprocessor.txt b/test/corpus/preprocessor.txt
index 51f03d5ef..71dc6b705 100644
--- a/test/corpus/preprocessor.txt
+++ b/test/corpus/preprocessor.txt
@@ -40,6 +40,8 @@ Object-like macro definitions
#define SIX(a, \
b) x \
+ y
+#define SEVEN 7/* seven has an
+ * annoying comment */
--------------------------------------------------------------------------------
@@ -66,7 +68,11 @@ Object-like macro definitions
parameters: (preproc_params
(identifier)
(identifier))
- value: (preproc_arg)))
+ value: (preproc_arg))
+ (preproc_def
+ name: (identifier)
+ value: (preproc_arg)
+ (comment)))
================================================================================
Function-like macro definitions