diff options
Diffstat (limited to 'lib/tests/misc.nix')
-rw-r--r-- | lib/tests/misc.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 110716ca69132..00eeaa2a77d79 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -534,8 +534,8 @@ runTests { a.b = 1; a.c = a; in { - expr = generators.toPretty { depthLimit = 2; } a; - expected = "{\n b = 1;\n c = {\n b = 1;\n c = {\n b = <unevaluated>;\n c = <unevaluated>;\n };\n };\n}"; + expr = generators.toPretty { } (generators.withRecursion { throwOnDepthLimit = false; depthLimit = 2; } a); + expected = "{\n b = 1;\n c = {\n b = \"<unevaluated>\";\n c = {\n b = \"<unevaluated>\";\n c = \"<unevaluated>\";\n };\n };\n}"; }; testToPrettyLimitThrow = @@ -543,7 +543,8 @@ runTests { a.b = 1; a.c = a; in { - expr = (builtins.tryEval (generators.toPretty { depthLimit = 2; throwOnDepthLimit = true; } a)).success; + expr = (builtins.tryEval + (generators.toPretty { } (generators.withRecursion { depthLimit = 2; } a))).success; expected = false; }; |