From 197fe37daef242596900bcab948d6fc14348f910 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 29 Aug 2022 17:33:30 -0700 Subject: feat(tvix/eval): Support builtins.length Get the length of a list Change-Id: I41d91e96d833269541a1b3c23b7cc879f96d1e5a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6407 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.exp new file mode 100644 index 000000000000..e80eb6ef1465 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.exp @@ -0,0 +1 @@ +[ 0 1 3 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix new file mode 100644 index 000000000000..ef1f638cbbdc --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-length.nix @@ -0,0 +1,5 @@ +[ + (builtins.length []) + (builtins.length [ 1 ]) + (builtins.length [ "one" "two" "three" ]) +] -- cgit 1.4.1