diff options
Diffstat (limited to 'js/scripting-lang/tests/11_edge_cases.txt')
-rw-r--r-- | js/scripting-lang/tests/11_edge_cases.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/scripting-lang/tests/11_edge_cases.txt b/js/scripting-lang/tests/11_edge_cases.txt index ceb39b4..bff51ef 100644 --- a/js/scripting-lang/tests/11_edge_cases.txt +++ b/js/scripting-lang/tests/11_edge_cases.txt @@ -13,18 +13,18 @@ negative3 : -0; /* Test complex unary minus expressions */ complex_negative1 : -(-5); complex_negative2 : -(-(-3)); -complex_negative3 : -5 + 3; +complex_negative3 : (-5) + 3; ..assert complex_negative1 = 5; ..assert complex_negative2 = -3; ..assert complex_negative3 = -2; /* Test unary minus in function calls */ -abs : x -> case x of - x < 0 : -x - _ : x; +abs : x -> when x is + x < 0 then -x + _ then x; -abs1 : abs -5; +abs1 : abs (-5); abs2 : abs 5; ..assert abs1 = 5; @@ -40,9 +40,9 @@ nested3 : -((2 + 3) * 4); ..assert nested3 = -20; /* Test unary minus with function references */ -negate : x -> -x; -negated1 : negate 5; -negated2 : negate -3; +myNegate : x -> -x; +negated1 : myNegate 5; +negated2 : myNegate (-3); ..assert negated1 = -5; ..assert negated2 = 3; |