diff --git a/tests/modules/programs/zsh/default.nix b/tests/modules/programs/zsh/default.nix index 25aa3b470..479238649 100644 --- a/tests/modules/programs/zsh/default.nix +++ b/tests/modules/programs/zsh/default.nix @@ -1,4 +1,5 @@ { + zsh-local-variables = ./local-variables.nix; zsh-session-variables = ./session-variables.nix; zsh-history-path-new-default = ./history-path-new-default.nix; zsh-history-path-new-custom = ./history-path-new-custom.nix; diff --git a/tests/modules/programs/zsh/local-variables.nix b/tests/modules/programs/zsh/local-variables.nix new file mode 100644 index 000000000..e22ad1894 --- /dev/null +++ b/tests/modules/programs/zsh/local-variables.nix @@ -0,0 +1,30 @@ +{ lib, ... }: + +with lib; + +{ + config = { + programs.zsh = { + enable = true; + + localVariables = rec { + V1 = true; + V2 = false; + V3 = "some-string"; + V4 = 42; + V5 = [ V1 V2 V3 V4 ]; + }; + }; + + test.stubs.zsh = { }; + + nmt.script = '' + assertFileExists home-files/.zshrc + assertFileContains home-files/.zshrc 'V1=true' + assertFileContains home-files/.zshrc 'V2=false' + assertFileContains home-files/.zshrc 'V3="some-string"' + assertFileContains home-files/.zshrc 'V4="42"' + assertFileContains home-files/.zshrc 'V5=(true false "some-string" "42")' + ''; + }; +}