mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 05:56:03 +01:00
Add tests/f/lang/eval-okay-tryeval-failed-thunk-reeval
This commit is contained in:
parent
b13143280c
commit
6de4db100f
3 changed files with 9 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
trace: throwing
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
"done"
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Since Nix 2.32, errors are memoized
|
||||||
|
let
|
||||||
|
# This attribute value will only be evaluated once.
|
||||||
|
foo = builtins.trace "throwing" throw "nope";
|
||||||
|
in
|
||||||
|
# Trigger and catch the error twice.
|
||||||
|
builtins.seq (builtins.tryEval foo).success builtins.seq (builtins.tryEval foo).success "done"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue