From 3d77b28eacc940356e94c36017fb2d9f1a1b7ec2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 2 Aug 2013 18:39:40 +0200 Subject: Add comparison operators ‘<’, ‘<=’, ‘>’ and ‘>=’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/lang/eval-okay-arithmetic.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/lang/eval-okay-arithmetic.nix') 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) ]; + } -- cgit 1.4.1