lix/tests
Alois Wohlschlager 81a0624d76
libexpr/print: pretty-print idempotently
When pretty-printing is enabled, previously an unforced thunk would trigger
indentation, even when it subsequently does not evaluate to a nested structure.
The resulting output looked inconsistent, and furthermore pretty-printing was
not idempotent (since pretty-printing the same value again, which is now fully
evaluated, will not trigger indentation).
When strict evaluation is enabled, force the item before inspecting its type,
so that it is properly known whether it contains a nested structure.
Furthermore, there is no need to cause indentation for unforced thunks, since
the very next operation will be printing them as `«thunk»`.

This is mostly a port of https://github.com/NixOS/nix/pull/11100 , but we only
force the item when it's going to be forced anyway due to strict
pretty-printing, and a new test was written since the REPL testing framework in
Lix is different.

Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
Change-Id: Ib7560fe531d09e05ca6b2037a523fe21a26d9d58
2024-07-18 18:41:28 +02:00
..
functional libexpr/print: pretty-print idempotently 2024-07-18 18:41:28 +02:00
installer chore: rebrand Nix to Lix when it makes sense 2024-06-01 20:31:24 +02:00
nixos nix3-upgrade-nix: always use the /new/ nix-env to perform the installation 2024-07-15 15:26:53 -06:00
unit libstore: remove WriteConn::sink fields 2024-07-16 00:57:42 +00:00
repl-completion.nix Merge pull request #10799 from hercules-ci/safer-tab-completion 2024-06-16 04:03:32 +00:00