From 5d147e125cea69e9a3b12f0ef64c64f42985c65e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 2 Aug 2013 17:35:59 +0200 Subject: Add a unary integer negation operator This allows saying "-1" instead of "builtins.sub 0 1". --- tests/lang/eval-okay-arithmetic.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (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 1f45b122a2bb..76bef919bdab 100644 --- a/tests/lang/eval-okay-arithmetic.nix +++ b/tests/lang/eval-okay-arithmetic.nix @@ -16,6 +16,11 @@ let { range = range_ []; */ - body = sum (range 1 50) + 123 + 456; + x = 12; + body = sum + [ (sum (range 1 50)) + (123 + 456) + (0 + -10 + -(-11) + -x) + ]; } -- cgit 1.4.1