mirror of
https://github.com/nix-community/home-manager
synced 2024-11-16 08:09:45 +01:00
zsh: add test for programs.zsh.localVariables
This commit is contained in:
parent
31357486b0
commit
8db990e559
2 changed files with 31 additions and 0 deletions
|
@ -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;
|
||||
|
|
30
tests/modules/programs/zsh/local-variables.nix
Normal file
30
tests/modules/programs/zsh/local-variables.nix
Normal file
|
@ -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")'
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue