Merge pull request #168374 from Ma27/special-attrs-in-with-recursion
lib/generators: withRecursion: don't break attr-sets with special attrs
This commit is contained in:
@@ -674,6 +674,21 @@ runTests {
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testWithRecursionDealsWithFunctors =
|
||||
let
|
||||
functor = {
|
||||
__functor = self: { a, b, }: null;
|
||||
};
|
||||
a = {
|
||||
value = "1234";
|
||||
b = functor;
|
||||
c.d = functor;
|
||||
};
|
||||
in {
|
||||
expr = generators.toPretty { } (generators.withRecursion { depthLimit = 1; throwOnDepthLimit = false; } a);
|
||||
expected = "{\n b = <function, args: {a, b}>;\n c = {\n d = \"<unevaluated>\";\n };\n value = \"<unevaluated>\";\n}";
|
||||
};
|
||||
|
||||
testToPrettyMultiline = {
|
||||
expr = mapAttrs (const (generators.toPretty { })) rec {
|
||||
list = [ 3 4 [ false ] ];
|
||||
|
||||
Reference in New Issue
Block a user