From 844d28894978ff5522cb57947edbeb8f28dad309 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 2 Oct 2022 19:59:37 +0300 Subject: feat(tvix/eval): implement `builtins.all` Change-Id: I19ec2b2194681efd73041f4aa1e5f2c893e839c2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6844 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix new file mode 100644 index 0000000000..12d62632dd --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix @@ -0,0 +1,15 @@ +[ + (builtins.all (x: x) [ ]) + (builtins.all (x: x) [ true true true ]) + (builtins.all (x: x) [ false false false ]) + (builtins.all (x: x) [ true true false ]) + (builtins.all (x: x) [ false true true ]) + + # evaluation should short-circuit + (builtins.all (x: x) [ true false (builtins.abort "should be unreachable") ]) + + # arbitrary functions supported + (builtins.all (x: x * 2 == 42) [ ]) + (builtins.all (x: x * 2 == 42) [ 21 21 21 ]) + (builtins.all (x: x * 2 == 42) [ 1 2 3 ]) +] -- cgit 1.4.1