summaryrefslogtreecommitdiffhomepage
path: root/tests/02_runtime
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-15 11:22:02 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-15 11:22:02 +0200
commitbbeeb113926ba117791f67d49487edb908bf8893 (patch)
tree443272668c9bd81e9e75d67285a30f23a121ffe7 /tests/02_runtime
parentce01a7fdc8d49977e3d46dab0615580f90c6525c (diff)
syntax: allow consecutive case values
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/02_runtime')
-rw-r--r--tests/02_runtime/04_switch_case26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/02_runtime/04_switch_case b/tests/02_runtime/04_switch_case
index 2102ee5..d3f6c94 100644
--- a/tests/02_runtime/04_switch_case
+++ b/tests/02_runtime/04_switch_case
@@ -271,3 +271,29 @@ In test(), line 6, byte 7:
print(test(1), "\n");
%}
-- End --
+
+
+11. Ensure that consecutive cases values are properly handled.
+
+-- Expect stdout --
+three and four
+-- End --
+
+-- Testcase --
+{%
+ switch (3) {
+ case 1:
+ case 2:
+ print("one and two\n");
+ break;
+
+ case 3:
+ case 4:
+ print("three and four\n");
+ break;
+
+ default:
+ print("five\n");
+ }
+%}
+-- End --