lib/attrsets: add concatMapAttrs

This commit is contained in:
figsoda
2022-11-16 12:20:38 -05:00
parent 4536ebad69
commit f993f8a186
3 changed files with 38 additions and 2 deletions

View File

@@ -478,6 +478,23 @@ runTests {
# ATTRSETS
testConcatMapAttrs = {
expr = concatMapAttrs
(name: value: {
${name} = value;
${name + value} = value;
})
{
foo = "bar";
foobar = "baz";
};
expected = {
foo = "bar";
foobar = "baz";
foobarbaz = "baz";
};
};
# code from the example
testRecursiveUpdateUntil = {
expr = recursiveUpdateUntil (path: l: r: path == ["foo"]) {