aboutsummaryrefslogtreecommitdiff
path: root/tests/lang/eval-okay-arithmetic.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-02 18:39:40 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-02 18:39:40 +0200
commit3d77b28eacc940356e94c36017fb2d9f1a1b7ec2 (patch)
treeabf8ac9c0ea547078885db3ad699bb2da5d25752 /tests/lang/eval-okay-arithmetic.nix
parent47701677e88230abf7d9106c55f46aa660643ce7 (diff)
Add comparison operators ‘<’, ‘<=’, ‘>’ and ‘>=’
Diffstat (limited to 'tests/lang/eval-okay-arithmetic.nix')
-rw-r--r--tests/lang/eval-okay-arithmetic.nix23
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)
];
+
}