diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-12-16 21:29:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 21:29:52 +0100 |
commit | 8c46629b839b447f1afa4d8d0d9ad3398eeb027a (patch) | |
tree | 0f83e7171de489dfa273ce69b902a1bf30a15365 | |
parent | 7caf9f33f5454cc2a6ac240fa4ca73573c148461 (diff) | |
parent | d9fbe3e20860be305c9d42945b4d0ef73067007e (diff) |
Merge pull request #5786 from Infinisil/groupBy-tests
Add a test case for builtins.groupBy
-rw-r--r-- | tests/lang/eval-okay-groupBy.exp | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-groupBy.nix | 5 |
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) |