diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_parens_in_when.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_parens_in_when.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_parens_in_when.txt b/js/scripting-lang/scratch_tests/test_parens_in_when.txt new file mode 100644 index 0000000..4b441b4 --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_parens_in_when.txt @@ -0,0 +1,22 @@ +/* Test parentheses in when expressions */ + +/* Test simple parentheses */ +test1 : when (5) is + 5 then "parentheses work" + _ then "parentheses don't work"; + +..out test1; + +/* Test parentheses with arithmetic */ +test2 : when (5 + 3) is + 8 then "arithmetic in parentheses works" + _ then "arithmetic in parentheses doesn't work"; + +..out test2; + +/* Test parentheses with function calls */ +test3 : when (equals 5 5) is + true then "function call in parentheses works" + _ then "function call in parentheses doesn't work"; + +..out test3; \ No newline at end of file |