summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23 19:23:11 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23 19:23:11 +0200
commit14be783676adbb3517b2f73fee31c6f341575440 (patch)
tree759d4cec921a562e5c3f00ec9db251639ae5e526 /tests
parent39e27a04b8d1fc8251128b1f9f8f152b8c8a9b68 (diff)
Add primops all and any
These are used thousands of times during NixOS evaluation, so it's useful to speed them up.
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/eval-okay-any-all.exp1
-rw-r--r--tests/lang/eval-okay-any-all.nix11
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-any-all.exp b/tests/lang/eval-okay-any-all.exp
new file mode 100644
index 000000000..eb273f45b
--- /dev/null
+++ b/tests/lang/eval-okay-any-all.exp
@@ -0,0 +1 @@
+[ false false true true true true false true ]
diff --git a/tests/lang/eval-okay-any-all.nix b/tests/lang/eval-okay-any-all.nix
new file mode 100644
index 000000000..a3f26ea2a
--- /dev/null
+++ b/tests/lang/eval-okay-any-all.nix
@@ -0,0 +1,11 @@
+with builtins;
+
+[ (any (x: x == 1) [])
+ (any (x: x == 1) [2 3 4])
+ (any (x: x == 1) [1 2 3 4])
+ (any (x: x == 1) [4 3 2 1])
+ (all (x: x == 1) [])
+ (all (x: x == 1) [1])
+ (all (x: x == 1) [1 2 3])
+ (all (x: x == 1) [1 1 1])
+]