1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 07:31:03 +01:00
home-manager/tests/modules/programs/zsh/smart-formatting.nix
Austin Horstman 26ace005b7 tests/zsh: add comprehensive smart formatting test
Add test to verify intelligent width optimization of shell arrays.
The test demonstrates how formatShellArrayContent packs multiple items
per line
within reasonable width limits rather than one item per line.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-09-27 13:18:01 -05:00

47 lines
1.1 KiB
Nix

{
programs.zsh = {
enable = true;
# Add many setOptions to trigger multi-line formatting
setOptions = [
"AUTO_LIST"
"AUTO_PARAM_SLASH"
"AUTO_PUSHD"
"ALWAYS_TO_END"
"CORRECT"
"HIST_FCNTL_LOCK"
"HIST_VERIFY"
"INTERACTIVE_COMMENTS"
"MENU_COMPLETE"
"PUSHD_IGNORE_DUPS"
"PUSHD_TO_HOME"
"PUSHD_SILENT"
"NOTIFY"
"PROMPT_SUBST"
"MULTIOS"
"NOFLOWCONTROL"
"NO_CORRECT_ALL"
"NO_HIST_BEEP"
"NO_NOMATCH"
];
# This should also show intelligent formatting for history options
history = {
size = 50000;
save = 50000;
# These will create many disabled options
append = false;
ignoreDups = false;
ignoreAllDups = false;
saveNoDups = false;
findNoDups = false;
ignoreSpace = false;
expireDuplicatesFirst = false;
extended = false;
share = false;
};
};
nmt.script = ''
assertFileExists home-files/.zshrc
assertFileContent home-files/.zshrc ${./smart-formatting-expected.zshrc}
'';
}