tests/zsh: add highlighters overrride test

Test ability to drop main from arguments forcefully.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2026-01-26 09:39:08 -06:00
parent d0cdb4101f
commit 9de7d83327
2 changed files with 25 additions and 0 deletions

View file

@ -26,6 +26,7 @@
zsh-session-variables = ./session-variables.nix;
zsh-smart-formatting = ./smart-formatting.nix;
zsh-syntax-highlighting = ./syntax-highlighting.nix;
zsh-syntax-highlighting-override = ./syntax-highlighting-override.nix;
zsh-xdg-default = ./xdg-default.nix;
zsh-xdg-disabled = ./xdg-disabled.nix;
zsh-zprof = ./zprof.nix;

View file

@ -0,0 +1,24 @@
{ pkgs, lib, ... }:
{
programs.zsh = {
enable = true;
syntaxHighlighting = {
enable = true;
package = pkgs.hello;
highlighters = lib.mkForce [
"brackets"
"pattern"
"cursor"
];
styles.comment = "fg=#6c6c6c";
patterns."rm -rf *" = "fg=white,bold,bg=red";
};
};
nmt.script = ''
assertFileContains home-files/.zshrc "source ${pkgs.hello}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_HIGHLIGHTERS=(brackets pattern cursor)"
assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES[comment]='fg=#6c6c6c'"
'';
}