mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
lib.attrsets.concatMapAttrs: add test for handling duplicates
(cherry picked from commit f3e6fa555f)
This commit is contained in:
parent
aed9f7b95d
commit
23b3177402
1 changed files with 15 additions and 0 deletions
|
|
@ -2164,6 +2164,21 @@ runTests {
|
|||
};
|
||||
};
|
||||
|
||||
testConcatMapAttrsDuplicates = {
|
||||
expr =
|
||||
concatMapAttrs
|
||||
(name: value: {
|
||||
final = value;
|
||||
})
|
||||
{
|
||||
a = 1;
|
||||
b = 2;
|
||||
};
|
||||
expected = {
|
||||
final = 2;
|
||||
};
|
||||
};
|
||||
|
||||
testFilterAttrs = {
|
||||
expr = filterAttrs (n: v: n != "a" && (v.hello or false) == true) {
|
||||
a.hello = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue