about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_parens_disambiguation.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_parens_disambiguation.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_parens_disambiguation.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_parens_disambiguation.txt b/js/scripting-lang/scratch_tests/test_parens_disambiguation.txt
new file mode 100644
index 0000000..8863d8b
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_parens_disambiguation.txt
@@ -0,0 +1,29 @@
+/* Test if parentheses can help disambiguate complex expressions */
+
+/* Test modulo with parentheses */
+test1 : when (15 % 3) is
+  0 then "modulo in parentheses works"
+  _ then "modulo in parentheses doesn't work";
+
+..out test1;
+
+/* Test equals with parentheses */
+test2 : when (5 = 5) is
+  true then "equals in parentheses works"
+  _ then "equals in parentheses doesn't work";
+
+..out test2;
+
+/* Test complex expression with parentheses */
+test3 : when ((15 % 3) = 0) is
+  true then "complex expression in parentheses works"
+  _ then "complex expression in parentheses doesn't work";
+
+..out test3;
+
+/* Test multiple values with parentheses */
+test4 : when (15 % 3) (15 % 5) is
+  0 0 then "multiple values with parentheses work"
+  _ _ then "multiple values with parentheses don't work";
+
+..out test4; 
\ No newline at end of file