aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2021-12-16 19:59:13 +0100
committerSilvan Mosberger <contact@infinisil.com>2021-12-16 19:59:13 +0100
commitd9fbe3e20860be305c9d42945b4d0ef73067007e (patch)
tree0f83e7171de489dfa273ce69b902a1bf30a15365 /tests
parent7caf9f33f5454cc2a6ac240fa4ca73573c148461 (diff)
Add a test case for builtins.groupBy
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/eval-okay-groupBy.exp1
-rw-r--r--tests/lang/eval-okay-groupBy.nix5
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-groupBy.exp b/tests/lang/eval-okay-groupBy.exp
new file mode 100644
index 000000000..bfca5652a
--- /dev/null
+++ b/tests/lang/eval-okay-groupBy.exp
@@ -0,0 +1 @@
+{ "1" = [ 9 ]; "2" = [ 8 ]; "3" = [ 13 29 ]; "4" = [ 3 4 10 11 17 18 ]; "5" = [ 0 23 26 28 ]; "6" = [ 1 12 21 27 30 ]; "7" = [ 7 22 ]; "8" = [ 14 ]; "9" = [ 19 ]; b = [ 16 25 ]; c = [ 24 ]; d = [ 2 ]; e = [ 5 6 15 31 ]; f = [ 20 ]; }
diff --git a/tests/lang/eval-okay-groupBy.nix b/tests/lang/eval-okay-groupBy.nix
new file mode 100644
index 000000000..862d89dbd
--- /dev/null
+++ b/tests/lang/eval-okay-groupBy.nix
@@ -0,0 +1,5 @@
+with import ./lib.nix;
+
+builtins.groupBy (n:
+ builtins.substring 0 1 (builtins.hashString "sha256" (toString n))
+) (range 0 31)