From 75ba7c01200650ad76658da948f39e970cefb5c2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 15 Aug 2022 02:15:39 +0300 Subject: [PATCH] test(tvix/eval): add basic tests for with expressions Change-Id: I94664090e7a2b060dfbe21c1eeb859fb31e417b0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6225 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: grfn --- tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix | 4 ++++ tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix | 5 +++++ 4 files changed, 11 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.exp new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.exp @@ -0,0 +1 @@ +2 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix new file mode 100644 index 000000000..ea5ef568e --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-nested-with.nix @@ -0,0 +1,4 @@ +let + set1 = { a = 1; }; + set2 = { a = 2; }; +in with set1; with set2; a diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.exp new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.exp @@ -0,0 +1 @@ +1 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix new file mode 100644 index 000000000..64962b50f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-with.nix @@ -0,0 +1,5 @@ +let + set = { + a = 1; + }; +in with set; a