From fefa8c55c45d82fc1d81e02a96e126812e1e1223 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 5 Sep 2022 11:42:53 -0700 Subject: feat(tvix/eval): Support builtins.tail TL;DR: - support `builtins.tail` - define `ErrorKind::TailEmptyList` and canonical error code - support basic unit tests Unsure whether or not the error should be a dedicated `ErrorKind`... Change-Id: Iae90fda1bb21ce7bdb1aaa2aeb2b8c1e6dcb0f05 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6545 Reviewed-by: wpcarro Autosubmit: wpcarro Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.nix | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.exp new file mode 100644 index 0000000000..b9e3aa1ef7 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.exp @@ -0,0 +1 @@ +[ [ ] [ 2 3 ] ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.nix new file mode 100644 index 0000000000..2be9496a98 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tail.nix @@ -0,0 +1,4 @@ +[ + (builtins.tail [ "foo" ]) + (builtins.tail [ 1 2 3 ]) +] -- cgit 1.4.1