From 70b27a608090b29b6ae8e455d8f18c7099b2b39d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 28 Aug 2022 19:40:18 +0300 Subject: test(tvix/eval): add a test case for nested, deferred upvalues This test case was previously broken by the bug introduced by confusing local and stack indexes. Change-Id: Ibef299dad266c6105deac1da5dde112fe9f640b1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6341 Tested-by: BuildkiteCI Reviewed-by: sterni --- .../eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.exp | 1 + .../eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix (limited to 'tvix') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.exp new file mode 100644 index 000000000000..209e3ef4b624 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.exp @@ -0,0 +1 @@ +20 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix new file mode 100644 index 000000000000..358925e992c7 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix @@ -0,0 +1,6 @@ +let + doubler = n: outer n; + outer = let inner = n: a * n; + a = 2; + in inner; +in doubler 10 -- cgit 1.4.1