From 515c0e80f092d58157998a22877d59029267cbf8 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Mon, 17 Jun 2024 08:01:33 +0000 Subject: [PATCH] Add test case for if. 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..a14fd4696 --- /dev/null +++ b/test/grammar/if/if_stmt/test_5/main.k @@ -0,0 +1,8 @@ +_nodes=[] + +if True: + print("Condition is 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..cf864e293 --- /dev/null +++ b/test/grammar/if/if_stmt/test_5/stdout.golden @@ -0,0 +1,2 @@ +Condition is true. +nodes: []