From 0532cb61720355f5917c467440eb2b3cb297f2ba Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 16 Sep 2022 19:56:23 +0300 Subject: test(tvix/eval): add tests for legacy let syntax Change-Id: I42d6240056c93cf90986ef3fec88b42f804b06ef Reviewed-on: https://cl.tvl.fyi/c/depot/+/6613 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix | 9 +++++++++ tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix | 4 ++++ 4 files changed, 15 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix (limited to 'tvix/eval/src/tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.exp new file mode 100644 index 000000000000..5d2955ffd5e1 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.exp @@ -0,0 +1 @@ +{ one = 42; two = 42; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix new file mode 100644 index 000000000000..87fcffadee5f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix @@ -0,0 +1,9 @@ +let { + a = 21; + b = body.one; + + body = { + one = a * 2; + two = b; + }; +} diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.exp new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.exp @@ -0,0 +1 @@ +42 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix new file mode 100644 index 000000000000..850e0252c2b6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-legacy-let.nix @@ -0,0 +1,4 @@ +let { + a = 21; + body = a * 2; +} -- cgit 1.4.1