From caf9cbf71147054c01c6fdf49773d646cbfb46eb Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Wed, 12 Oct 2022 02:46:20 -0700 Subject: feat(tvix/eval): implement builtins.dirOf This commit causes the test eval-okay-builtins.nix to pass. It also adds tests/tvix_tests/eval-okay-dirof.nix which has better coverage than the nix tests for this builtin. Signed-off-by: Adam Joseph Change-Id: I71d96b48680696fd6e4fea3a9861742b35cfaa66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6987 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-dirof.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-dirof.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-dirof.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-dirof.nix (limited to 'tvix/eval/src/tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-dirof.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-dirof.exp new file mode 100644 index 000000000000..ff464e4c30d4 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-dirof.exp @@ -0,0 +1 @@ +[ /foo "." "foo//" "foo" "." "." / "/" ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-dirof.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-dirof.nix new file mode 100644 index 000000000000..13cf47320515 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-dirof.nix @@ -0,0 +1,10 @@ +[ + (builtins.dirOf /foo/bar) + (builtins.dirOf "foo") + (builtins.dirOf "foo///") + (builtins.dirOf "foo/bar") + (builtins.dirOf "./.") + (builtins.dirOf "") + (builtins.dirOf /.) + (builtins.toString (builtins.dirOf /.)) +] -- cgit 1.4.1