From 9873aaf4d21ef4481500b9ddacb03c6a86375b27 Mon Sep 17 00:00:00 2001 From: Lan Date: Thu, 20 Jun 2024 17:41:34 +0800 Subject: [PATCH] Add test case for if. (#1416) Signed-off-by: Lan Liang --- test/grammar/if/if_stmt/test_5/main.k | 8 ++++++++ test/grammar/if/if_stmt/test_5/stdout.golden | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 test/grammar/if/if_stmt/test_5/main.k create mode 100644 test/grammar/if/if_stmt/test_5/stdout.golden diff --git a/test/grammar/if/if_stmt/test_5/main.k b/test/grammar/if/if_stmt/test_5/main.k new file mode 100644 index 000000000..b502b908c --- /dev/null +++ b/test/grammar/if/if_stmt/test_5/main.k @@ -0,0 +1,8 @@ +_nodes=[] + +if True: + print("Condition: True") +elif False: + _nodes+=[] + +nodes=_nodes diff --git a/test/grammar/if/if_stmt/test_5/stdout.golden b/test/grammar/if/if_stmt/test_5/stdout.golden new file mode 100644 index 000000000..6f7d259d2 --- /dev/null +++ b/test/grammar/if/if_stmt/test_5/stdout.golden @@ -0,0 +1,2 @@ +Condition: True +nodes: []