Loading lib/tests/misc.nix +20 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ let evalModules extends filter filterAttrs fix fold foldAttrs Loading Loading @@ -1102,6 +1103,25 @@ runTests { }; }; testFilterAttrs = { expr = filterAttrs (n: v: n != "a" && (v.hello or false) == true) { a.hello = true; b.hello = true; c = { hello = true; world = false; }; d.hello = false; }; expected = { b.hello = true; c = { hello = true; world = false; }; }; }; # code from example testFoldlAttrs = { expr = { Loading Loading
lib/tests/misc.nix +20 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ let evalModules extends filter filterAttrs fix fold foldAttrs Loading Loading @@ -1102,6 +1103,25 @@ runTests { }; }; testFilterAttrs = { expr = filterAttrs (n: v: n != "a" && (v.hello or false) == true) { a.hello = true; b.hello = true; c = { hello = true; world = false; }; d.hello = false; }; expected = { b.hello = true; c = { hello = true; world = false; }; }; }; # code from example testFoldlAttrs = { expr = { Loading