From 9c7d8e791af7f6bfd4e518120cef4e36ba087fd6 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 18 Oct 2022 21:54:38 -0700 Subject: test(tvix/eval): add a test case for groupBy with thunks We have to be careful implementing `builtins.groupBy`, since the list may contain thunks, and tvix's to_xxx() functions do not work on thunks. Signed-off-by: Adam Joseph Change-Id: I182b6fc2d4296f864ed16744ef70b153e8e6978a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7039 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.exp new file mode 100644 index 0000000000..94649819ca --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.exp @@ -0,0 +1 @@ +{ fred = [ { x = "fred"; y = "fred"; } ]; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix new file mode 100644 index 0000000000..d62ae628dc --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix @@ -0,0 +1,6 @@ + +builtins.groupBy + (v: v.x) + [ (rec { y = x; x = "fred"; }) ] + + -- cgit 1.4.1