From 678533bfc487dddfc4a2ad87b307159af952a225 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 3 Sep 2022 04:25:02 +0300 Subject: test(tvix/eval): add test for stack slot accounting edge-case This was fixed by some of the previous commits around scopes. It's somewhat similar to a few other tests, but I had this one failing earlier and everything else succeeding, so it is useful to keep it around for sure. Change-Id: Ie6cf372b5c805daf992cd87aeb3dfe91542c381c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6431 Reviewed-by: sterni Tested-by: BuildkiteCI --- .../src/tests/tvix_tests/eval-okay-nested-let-slots.exp | 1 + .../src/tests/tvix_tests/eval-okay-nested-let-slots.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.exp new file mode 100644 index 0000000000..e45ef1da2f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.exp @@ -0,0 +1 @@ +[ 1 2 3 4 5 6 7 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix new file mode 100644 index 0000000000..811bb4361b --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-let-slots.nix @@ -0,0 +1,17 @@ +# This test deals with a tricky edge-case around scopes, where the +# stack slot accounting must correctly account for the position at +# which the body of a let expression is being initialised when +# resolving upvalues. + +let + a = 1; + b = 2; + outer = let + c = 3; + d = 4; + inner = let + e = 5; + f = 6; + in g: [ a b c d e f g ]; + in inner; +in outer 7 -- cgit 1.4.1