lib/recursiveUpdateUntil: add a test & release note for fix

This commit is contained in:
Profpatsch
2018-08-15 17:16:56 +02:00
parent b63ec64521
commit d817452e29
2 changed files with 33 additions and 0 deletions
+24
View File
@@ -213,6 +213,30 @@ runTests {
};
# ATTRSETS
# code from the example
testRecursiveUpdateUntil = {
expr = recursiveUpdateUntil (path: l: r: path == ["foo"]) {
# first attribute set
foo.bar = 1;
foo.baz = 2;
bar = 3;
} {
#second attribute set
foo.bar = 1;
foo.quz = 2;
baz = 4;
};
expected = {
foo.bar = 1; # 'foo.*' from the second set
foo.quz = 2; #
bar = 3; # 'bar' from the first set
baz = 4; # 'baz' from the second set
};
};
# GENERATORS
# these tests assume attributes are converted to lists
# in alphabetical order