diff options
Diffstat (limited to 'lib/tests/misc.nix')
-rw-r--r-- | lib/tests/misc.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index fcccf89cc888c..ccfa9cc5ec14f 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -613,6 +613,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 ] ]; |