diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-02 18:39:40 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-02 18:39:40 +0200 |
commit | 3d77b28eacc940356e94c36017fb2d9f1a1b7ec2 (patch) | |
tree | abf8ac9c0ea547078885db3ad699bb2da5d25752 /tests/lang/eval-okay-arithmetic.nix | |
parent | 47701677e88230abf7d9106c55f46aa660643ce7 (diff) |
Add comparison operators ‘<’, ‘<=’, ‘>’ and ‘>=’
Diffstat (limited to 'tests/lang/eval-okay-arithmetic.nix')
-rw-r--r-- | tests/lang/eval-okay-arithmetic.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-arithmetic.nix b/tests/lang/eval-okay-arithmetic.nix index 70179c5d1..62a0ada06 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) ]; + } |