1
0
Fork 0
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:
Giel van Schijndel 2024-04-12 14:11:29 +02:00
parent 31357486b0
commit 8db990e559
No known key found for this signature in database
GPG key ID: 3E52E1D396DFB43B
2 changed files with 31 additions and 0 deletions

View file

@ -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;

View 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")'
'';
};
}