diff options
Diffstat (limited to 'js/scripting-lang/tests/integration_04_mini_case_multi_param.txt')
-rw-r--r-- | js/scripting-lang/tests/integration_04_mini_case_multi_param.txt | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/js/scripting-lang/tests/integration_04_mini_case_multi_param.txt b/js/scripting-lang/tests/integration_04_mini_case_multi_param.txt index 279676d..1814ae5 100644 --- a/js/scripting-lang/tests/integration_04_mini_case_multi_param.txt +++ b/js/scripting-lang/tests/integration_04_mini_case_multi_param.txt @@ -1,17 +1,21 @@ -/* Multi-parameter case expression at top level */ -x : 1; -y : 2; -result1 : when x y is - 1 2 then "matched" - _ _ then "not matched"; +/* Integration Test: Multi-parameter case expression at top level */ -/* Multi-parameter case expression inside a function */ -f : a b -> when a b is - 1 2 then "matched" - _ _ then "not matched"; -result2 then f 1 2; -result3 then f 3 4; +/* Test multi-parameter case expressions */ +compare : x y -> + when x y is + 0 0 then "both zero" + 0 _ then "x is zero" + _ 0 then "y is zero" + _ _ then "neither zero"; -..out result1; -..out result2; -..out result3; \ No newline at end of file +test1 : compare 0 0; +test2 : compare 0 5; +test3 : compare 5 0; +test4 : compare 5 5; + +..assert test1 = "both zero"; +..assert test2 = "x is zero"; +..assert test3 = "y is zero"; +..assert test4 = "neither zero"; + +..out "Multi-parameter case expression test completed"; \ No newline at end of file |