diff options
author | Vincent Ambo <mail@tazj.in> | 2022-08-13T17·20+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-08-29T20·13+0000 |
commit | 36748fe4f65d85049c5aec2df4828668803ad30b (patch) | |
tree | a345f43a2179884707347f695cc21a9d5498d73a /tvix/eval | |
parent | 52f4915317e22b14d78fe82fae83444239d5107f (diff) |
test(tvix/eval): add basic tests for let expressions r/4527
Change-Id: I788504f0c1848a1422c99006bf659738df614716 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6191 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval')
6 files changed, 17 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.exp new file mode 100644 index 000000000000..5776134d0e41 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.exp @@ -0,0 +1 @@ +[ 1 2 3 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix new file mode 100644 index 000000000000..b6c37c34f949 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix @@ -0,0 +1,5 @@ +let + a = 1; + "b" = 2; + ${"c"} = 3; +in [ a b c ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.exp new file mode 100644 index 000000000000..00750edc07d6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.exp @@ -0,0 +1 @@ +3 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix new file mode 100644 index 000000000000..7a65a5b1cc9f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix @@ -0,0 +1,5 @@ +let + a = 1; + b = 2; + c = a + b; +in c diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.exp new file mode 100644 index 000000000000..00750edc07d6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.exp @@ -0,0 +1 @@ +3 diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix new file mode 100644 index 000000000000..b440a220ff6d --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-simple-let.nix @@ -0,0 +1,4 @@ +let + a = 1; + b = 2; +in a + b |