about summary refs log blame commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-any.nix
blob: 2c659f130b6543a6b464e5621bb1c65c2a4fbd54 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                               
[
  (builtins.any (x: x) [ ])
  (builtins.any (x: x) [ true true true ])
  (builtins.any (x: x) [ false false false ])
  (builtins.any (x: x) [ true true false ])
  (builtins.any (x: x) [ false true true ])

  # evaluation should short-circuit
  (builtins.any (x: x) [ false true (builtins.abort "should be unreachable") ])

  # arbitrary functions supported
  (builtins.any (x: x * 2 == 42) [ ])
  (builtins.any (x: x * 2 == 42) [ 7 21 42 ])
  (builtins.any (x: x * 2 == 42) [ 1 2 3 ])
]