tvl-depot/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-all.nix
Vincent Ambo 844d288949 feat(tvix/eval): implement builtins.all
Change-Id: I19ec2b2194681efd73041f4aa1e5f2c893e839c2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6844
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-10-03 17:39:09 +00:00

15 lines
490 B
Nix

[
(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 ])
]