From 240d90aa8a1ee9d9ac827fe19ea42d086be787d7 Mon Sep 17 00:00:00 2001 From: sterni Date: Wed, 7 Sep 2022 17:11:40 +0200 Subject: fix(tvix/eval): wrap asserts in a thunk As the new test case demonstrates, asserts need to be evaluated lazily. Change-Id: I808046722c5a504e9497855ca5026d255c7a4c34 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6494 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: sterni --- tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp new file mode 100644 index 000000000000..48082f72f087 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp @@ -0,0 +1 @@ +12 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix new file mode 100644 index 000000000000..5a36964976ca --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix @@ -0,0 +1,8 @@ +assert true; + +let + x = assert false; 13; + y = 12; +in + +{ inherit x y; }.y -- cgit 1.4.1