git.iko.soy/typeable/nixpkgs
on master help sign in
lib/recursiveUpdateUntil: add a test & release note for fix
commitd817452e296b6578bbbf940cc6f899602792081e authorProfpatsch <mail@profpatsch.de> dateWed 15 Aug 2018, 00:13 (8 years ago) parentb63ec64
2 files changed+33
lib/tests/misc.nix+24 nixos/doc/manual/release-notes/rl-1809.xml+9
lib/tests/misc.nix+24
@@ -213,6 +213,30 @@ runTests {
213213 };
214214
215215
216+# ATTRSETS
217+
218+ # code from the example
219+ testRecursiveUpdateUntil = {
220+ expr = recursiveUpdateUntil (path: l: r: path == ["foo"]) {
221+ # first attribute set
222+ foo.bar = 1;
223+ foo.baz = 2;
224+ bar = 3;
225+ } {
226+ #second attribute set
227+ foo.bar = 1;
228+ foo.quz = 2;
229+ baz = 4;
230+ };
231+ expected = {
232+ foo.bar = 1; # 'foo.*' from the second set
233+ foo.quz = 2; #
234+ bar = 3; # 'bar' from the first set
235+ baz = 4; # 'baz' from the second set
236+ };
237+ };
238+
239+
216240# GENERATORS
217241# these tests assume attributes are converted to lists
218242# in alphabetical order
nixos/doc/manual/release-notes/rl-1809.xml+9
@@ -278,6 +278,8 @@ inherit (pkgs.nixos {
278278 <literal>lib.traceCallXml</literal> has been deprecated. Please complain
279279 if you use the function regularly.
280280 </para>
281+ </listitem>
282+ <listitem>
281283 <para>
282284 The attribute <literal>lib.nixpkgsVersion</literal> has been deprecated in
283285 favor of <literal>lib.version</literal>. Please refer to the discussion in
@@ -285,6 +287,13 @@ inherit (pkgs.nixos {
285287 for further reference.
286288 </para>
287289 </listitem>
290+ <listitem>
291+ <para>
292+ <literal>lib.recursiveUpdateUntil</literal> was not acting according to its
293+ specification. It has been fixed to act according to the docstring, and a
294+ test has been added.
295+ </para>
296+ </listitem>
288297 <listitem>
289298 <para>
290299 The module for <option>security.dhparams</option> has two new options now: