about summary refs log tree commit diff
path: root/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix')
-rw-r--r--tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix
new file mode 100644
index 0000000000..c666e07f3a
--- /dev/null
+++ b/tvix/eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix
@@ -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