From 15c8e8c459c723c3e3c0c5fbfb0ed581b6521340 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 16 Sep 2022 19:53:15 +0300 Subject: test(tvix/eval): add some tests for recursive attribute sets Change-Id: I6a4fbe6d5aa6d2ce223bf77330d6c0f512d4300d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6612 Reviewed-by: sterni Tested-by: BuildkiteCI --- .../tvix_tests/eval-okay-recursive-attrs-all-features.exp | 1 + .../tvix_tests/eval-okay-recursive-attrs-all-features.nix | 13 +++++++++++++ .../tests/tvix_tests/eval-okay-simple-recursive-attrs.exp | 1 + .../tests/tvix_tests/eval-okay-simple-recursive-attrs.nix | 4 ++++ 4 files changed, 19 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.nix (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.exp new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.exp @@ -0,0 +1 @@ +42 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.nix new file mode 100644 index 000000000000..a234705b5e53 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.nix @@ -0,0 +1,13 @@ +let a = 1; +in +(rec { + inherit a; + + b = { + c = a + 20; + }; + + inherit (b) c; + + d = c * 2; +}).d diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.exp new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.exp @@ -0,0 +1 @@ +42 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.nix new file mode 100644 index 000000000000..c86ff80383c0 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.nix @@ -0,0 +1,4 @@ +(rec { + a = 21; + b = a * 2; +}).b -- cgit 1.4.1