1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-28 21:21:00 +01:00

Merge remote-tracking branch 'origin/master' into lazy-trees

This commit is contained in:
Eelco Dolstra 2023-02-21 13:32:59 +01:00
commit 5d1e5a09d1
36 changed files with 1150 additions and 740 deletions

View file

@ -120,7 +120,7 @@ let
makeTest = imageName: testName:
let image = images.${imageName}; in
with nixpkgsFor.${image.system};
with nixpkgsFor.${image.system}.native;
runCommand
"installer-test-${imageName}-${testName}"
{ buildInputs = [ qemu_kvm openssh ];

View file

@ -0,0 +1,5 @@
# Tests that the result of applying op is forced even if the value is never used
builtins.foldl'
(_: f: f null)
null
[ (_: throw "Not the final value, but is still forced!") (_: 23) ]

View file

@ -0,0 +1 @@
42

View file

@ -0,0 +1,9 @@
# Tests that the rhs argument of op is not forced unconditionally
let
lst = builtins.foldl'
(acc: x: acc ++ [ x ])
[ ]
[ 42 (throw "this shouldn't be evaluated") ];
in
builtins.head lst

View file

@ -0,0 +1 @@
42

View file

@ -0,0 +1,6 @@
# Checks that the nul value for the accumulator is not forced unconditionally.
# Some languages provide a foldl' that is strict in this argument, but Nix does not.
builtins.foldl'
(_: x: x)
(throw "This is never forced")
[ "but the results of applying op are" 42 ]