From 2f91543a42e14a790b5a5dabc008f8f3757d60db Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 17 Sep 2022 19:05:16 +0300 Subject: [PATCH] test(tvix/eval): add a test for lazy evaluation of with namespace Suggested by grfn in cl/6222 Change-Id: I8413af6404786bd43e5cb462a307cc236c4fb9ae Reviewed-on: https://cl.tvl.fyi/c/depot/+/6621 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.nix | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.nix diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.exp new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.exp @@ -0,0 +1 @@ +42 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.nix new file mode 100644 index 000000000..e4377df97 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-lazy-with.nix @@ -0,0 +1,6 @@ +# The 'namespace' of a with should only be evaluated if an identifier +# from it is actually accessed. + +with (builtins.throw "should not occur"); + +42