diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-02T16·39+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-02T16·39+0200 |
commit | 3d77b28eacc940356e94c36017fb2d9f1a1b7ec2 (patch) | |
tree | abf8ac9c0ea547078885db3ad699bb2da5d25752 /tests/lang | |
parent | 47701677e88230abf7d9106c55f46aa660643ce7 (diff) |
Add comparison operators ‘<’, ‘<=’, ‘>’ and ‘>=’
Diffstat (limited to 'tests/lang')
-rw-r--r-- | tests/lang/eval-okay-arithmetic.exp | 2 | ||||
-rw-r--r-- | tests/lang/eval-okay-arithmetic.nix | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/tests/lang/eval-okay-arithmetic.exp b/tests/lang/eval-okay-arithmetic.exp index d03b13697b27..d73ac3eb700d 100644 --- a/tests/lang/eval-okay-arithmetic.exp +++ b/tests/lang/eval-okay-arithmetic.exp @@ -1 +1 @@ -2170 +2185 diff --git a/tests/lang/eval-okay-arithmetic.nix b/tests/lang/eval-okay-arithmetic.nix index 70179c5d15b2..62a0ada0653e 100644 --- a/tests/lang/eval-okay-arithmetic.nix +++ b/tests/lang/eval-okay-arithmetic.nix @@ -18,6 +18,8 @@ let { x = 12; + err = abort "urgh"; + body = sum [ (sum (range 1 50)) (123 + 456) @@ -28,5 +30,26 @@ let { (3 * 4 * 5) (56088 / 123 / 2) (3 + 4 * const 5 0 - 6 / id 2) + + (if 3 < 7 then 1 else err) + (if 7 < 3 then err else 1) + (if 3 < 3 then err else 1) + + (if 3 <= 7 then 1 else err) + (if 7 <= 3 then err else 1) + (if 3 <= 3 then 1 else err) + + (if 3 > 7 then err else 1) + (if 7 > 3 then 1 else err) + (if 3 > 3 then err else 1) + + (if 3 >= 7 then err else 1) + (if 7 >= 3 then 1 else err) + (if 3 >= 3 then 1 else err) + + (if 2 > 1 == 1 < 2 then 1 else err) + (if 1 + 2 * 3 >= 7 then 1 else err) + (if 1 + 2 * 3 < 7 then err else 1) ]; + } |