aboutsummaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-okay-arithmetic.exp2
-rw-r--r--tests/lang/eval-okay-arithmetic.nix23
2 files changed, 24 insertions, 1 deletions
diff --git a/tests/lang/eval-okay-arithmetic.exp b/tests/lang/eval-okay-arithmetic.exp
index d03b13697..d73ac3eb7 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 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)
];
+
}